net.sourceforge.jabm.learning
Class MetaLearner
java.lang.Object
net.sourceforge.jabm.learning.AbstractLearner
net.sourceforge.jabm.learning.MetaLearner
- All Implemented Interfaces:
- java.io.Serializable, DiscreteLearner, Learner, StimuliResponseLearner
public class MetaLearner
- extends AbstractLearner
- implements StimuliResponseLearner, java.io.Serializable
- See Also:
- Serialized Form
-
-
Method Summary |
int |
act()
Request that the learner perform an action. |
int |
bestAction()
|
void |
dumpState(DataWriter out)
Write out our state data to the specified data writer. |
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 |
reward(double reward)
Reward the learning algorithm according to the last action it chose. |
int |
worstAction()
|
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 |
currentLearner
protected int currentLearner
subLearners
protected StimuliResponseLearner[] subLearners
masterLearner
protected StimuliResponseLearner masterLearner
MetaLearner
public MetaLearner()
MetaLearner
public MetaLearner(int numLearners)
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.
reward
public void reward(double reward)
- Description copied from interface:
StimuliResponseLearner
- Reward the learning algorithm according to the last action it chose.
- Specified by:
reward
in interface StimuliResponseLearner
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.
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.
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
bestAction
public int bestAction()
- Specified by:
bestAction
in interface StimuliResponseLearner
worstAction
public int worstAction()
- Specified by:
worstAction
in interface StimuliResponseLearner