net.sourceforge.jabm.learning
Class DumbLearner

java.lang.Object
  extended by net.sourceforge.jabm.learning.AbstractLearner
      extended by net.sourceforge.jabm.learning.DumbLearner
All Implemented Interfaces:
java.io.Serializable, DiscreteLearner, Learner

public class DumbLearner
extends AbstractLearner
implements DiscreteLearner, java.io.Serializable

A learner that chooses the same specified action on every iteration.

See Also:
Serialized Form
 

Field Summary
protected  int action
           
 
Fields inherited from class net.sourceforge.jabm.learning.AbstractLearner
monitor
 
Constructor Summary
DumbLearner()
           
 
Method Summary
 int act()
          Request that the learner perform an action.
 void dumpState(DataWriter out)
          Write out our state data to the specified data writer.
 int getAction()
           
 double getLearningDelta()
          Return a value indicative of the amount of learning that occured during the last iteration.
 int getNumberOfActions()
          Get the number of different possible actions this learner can choose from when it performs an action.
 void setAction(int action)
           
 
Methods inherited from class net.sourceforge.jabm.learning.AbstractLearner
monitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.jabm.learning.Learner
monitor
 

Field Detail

action

protected int action
Constructor Detail

DumbLearner

public DumbLearner()
Method Detail

setAction

public void setAction(int action)

getAction

public int getAction()

act

public int act()
Description copied from interface: DiscreteLearner
Request that the learner perform an action. Users of the learning algorithm should invoke this method on the learner when they wish to find out which action the learner is currently recommending.

Specified by:
act in interface DiscreteLearner
Returns:
An integer representing the action to be taken.

getLearningDelta

public double getLearningDelta()
Description copied from interface: Learner
Return a value indicative of the amount of learning that occured during the last iteration. Values close to 0.0 indicate that the learner has converged to an equilibrium state.

Specified by:
getLearningDelta in interface Learner
Specified by:
getLearningDelta in class AbstractLearner
Returns:
A double representing the amount of learning that occured.

dumpState

public void dumpState(DataWriter out)
Description copied from interface: Learner
Write out our state data to the specified data writer.

Specified by:
dumpState in interface Learner
Specified by:
dumpState in class AbstractLearner

getNumberOfActions

public int getNumberOfActions()
Description copied from interface: DiscreteLearner
Get the number of different possible actions this learner can choose from when it performs an action.

Specified by:
getNumberOfActions in interface DiscreteLearner
Returns:
An integer value representing the number of actions available.