agentland.device.intelliCD
Class QuickBrain

java.lang.Object
  |
  +--agentland.device.intelliCD.QuickBrain

public class QuickBrain
extends Object


Field Summary
 int MAX_CHANGE_STEP
           
 
Constructor Summary
QuickBrain(String name, ManagedConnection cnxn)
           
 
Method Summary
 Song chooseFirstSong()
           
 void computeReactions()
          compute the overall reaction, update the brain, and reset the relevant flags.
 Vector getBestNext(int n, int reaction)
           
 Song getCurrentSong()
           
 Song getNextSong()
          Returns the next song to be played.
 int getRepeatWait()
           
protected  double[] makeDecisionVector()
          Returns an array, each bin corrisponding to the song in that corrisponding spot in songs Vector, with the desirability of each song.
 void negativeReaction()
          Store reaction for _later_ computation
 void neutralReaction()
          Store reaction for _later_ computation
 void positiveReaction()
          Store reaction for _later_ computation
protected  boolean recentlyPlayed(Song id, int n)
           
 void registerCollection(SCollection coll)
           
 void saveSongs()
           
 int setAdventureCoef(int ac)
           
 int setRepeatWait(int n)
           
 void showHistory()
           
 void showScores(String column)
           
 void songPlayedNotify(Song s)
           
protected  double songWeight(int s)
          when building a decision vector, use this method to decide how to weight contribution from each of the past songs...
 String toHTML()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CHANGE_STEP

public int MAX_CHANGE_STEP
Constructor Detail

QuickBrain

public QuickBrain(String name,
                  ManagedConnection cnxn)
Method Detail

setAdventureCoef

public int setAdventureCoef(int ac)

registerCollection

public void registerCollection(SCollection coll)

makeDecisionVector

protected double[] makeDecisionVector()
Returns an array, each bin corrisponding to the song in that corrisponding spot in songs Vector, with the desirability of each song.

songWeight

protected double songWeight(int s)
when building a decision vector, use this method to decide how to weight contribution from each of the past songs...
Parameters:
s - How many songs back we are going for this weight

songPlayedNotify

public void songPlayedNotify(Song s)

chooseFirstSong

public Song chooseFirstSong()

getNextSong

public Song getNextSong()
Returns the next song to be played. If you didn't explicitly call any method to indicate how the user reacted to the previous song, this method will call neutralReaction on the last song

getCurrentSong

public Song getCurrentSong()

negativeReaction

public void negativeReaction()
Store reaction for _later_ computation

neutralReaction

public void neutralReaction()
Store reaction for _later_ computation

positiveReaction

public void positiveReaction()
Store reaction for _later_ computation

computeReactions

public void computeReactions()
compute the overall reaction, update the brain, and reset the relevant flags.

getRepeatWait

public int getRepeatWait()

setRepeatWait

public int setRepeatWait(int n)

getBestNext

public Vector getBestNext(int n,
                          int reaction)

recentlyPlayed

protected boolean recentlyPlayed(Song id,
                                 int n)
Returns:
true if song with index index was one of the n last songs played

toHTML

public String toHTML()

showHistory

public void showHistory()

saveSongs

public void saveSongs()

showScores

public void showScores(String column)