|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iastate.jrelm.rl.SimpleStatelessLearner<O>
O
- - The type of object being used to specify actions. This will default
to the most general Oject type.public class SimpleStatelessLearner<O>
The SimpleStatelessLearner packages together all the core learning components and a few pre-implemented reinforcement learning algorithms. It is meant to provide an easy way to drop reinforcement learning capabilities into an agent.
SimpleStatelessLearner is initialized with a collection of objects that represent or specify actions that an agent can take. It makes no difference what specific types are in the collection. The SimpleStatelessLearner just chooses objects from the collection and learns which ones are best to pick based on given feedback.
The desired reinforcement learning algorithm is specified by the type of parameters SimpleStatelessLearner is constructed with. For example, passing VREParameters to the constructor will build a SimpleStatelessLearner that uses a modified version of the Roth-Erev reinforcement learning algorithm. Once the learning algorithm is set through the constructor, it may not be changed for the life of the SimpleStatelessLearner object, though new parameters or policies may be given.
The nextAction() method is used to elicit a choice of action from SimpleStatelessLearner. This will return an object from the original collection given to the learner. Also, nextIndex() may be used to elicit a choice in the form of an int. This int is the index of the chosen action in the original collection.
Constructor Summary | |
---|---|
SimpleStatelessLearner(REParameters params,
java.util.Collection<O> actionList)
Build a SimpleStatelessLearner that uses a the Roth-Erev algorithm. |
|
SimpleStatelessLearner(REParameters params,
REPolicy<java.lang.Integer,SimpleAction<O>> aPolicy)
Build a SimpleStatelessLearner that uses the Roth-Erev algorithm with the given REPolicy. |
|
SimpleStatelessLearner(REParameters params,
SimpleActionDomain<O> aDomain)
Build a SimpleStatelessLearner that uses the Roth-Erev algorithm with the given SimpleActionDomain. |
|
SimpleStatelessLearner(VREParameters params,
java.util.Collection<O> actionList)
Build a SimpleStatelessLearner that uses a modified version of the Roth-Erev algorithm. |
|
SimpleStatelessLearner(VREParameters params,
REPolicy<java.lang.Integer,SimpleAction<O>> aPolicy)
Build a SimpleStatelessLearner that uses a modified version of the Roth-Erev algorithm with the given REPolicy. |
|
SimpleStatelessLearner(VREParameters params,
SimpleActionDomain<O> aDomain)
Build a SimpleStatelessLearner that uses a modified version of the Roth-Erev algorithm with the given SimpleActionDomain. |
Method Summary | |
---|---|
SimpleAction<O> |
chooseAction()
Elicits a choice of action. |
int |
chooseActionIndex()
Elicits a choice of action. |
O |
chooseActionRaw()
Elicits a choice of action. |
ReinforcementLearner |
getEngine()
|
java.lang.String |
getName()
Retrieves the name of the learning algorithm this learner implements. |
RLParameters |
getParameters()
Returns the learning parameters currently in use. |
StatelessPolicy<java.lang.Integer,SimpleAction<O>> |
getPolicy()
Retrieve the StatelessPolicy being used to represent learned knowledge. |
RLParameters |
makeParameters()
Creates an RLParameters object of the same type as given to the SimpleStatelessLearner constructor. |
void |
setParameters(RLParameters learnParams)
Set the learning parameters to use. |
void |
setPolicy(StatelessPolicy<java.lang.Integer,SimpleAction<O>> newPolicy)
Set the policy for this SimpleStatelessLearner. |
void |
update(Feedback<java.lang.Double> reward)
Give the learner feedback resulting from its last choice of action. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleStatelessLearner(REParameters params, java.util.Collection<O> actionList)
actionList
- - list of action choicesparameters
- - parameters for the Roth-Erev learnining algorithmRELearner
,
REParameters
public SimpleStatelessLearner(REParameters params, SimpleActionDomain<O> aDomain)
actionList
- - list of action choicesparameters
- - parameters for the Roth-Erev learnining algorithmpublic SimpleStatelessLearner(REParameters params, REPolicy<java.lang.Integer,SimpleAction<O>> aPolicy)
params
- - parameters for the modified Roth-Erev learnining algorithmaPolicy
- - an existing policy containing and ActionDomain and possibly
previously learned knowledgepublic SimpleStatelessLearner(VREParameters params, java.util.Collection<O> actionList)
actionList
- - list of action choicesparameters
- - parameters for the modified Roth-Erev learnining algorithmVRELearner
,
VREParameters
public SimpleStatelessLearner(VREParameters params, SimpleActionDomain<O> aDomain)
actionList
- - list of action choicesparameters
- - parameters for the modified Roth-Erev learnining algorithmVRELearner
,
VREParameters
public SimpleStatelessLearner(VREParameters params, REPolicy<java.lang.Integer,SimpleAction<O>> aPolicy)
params
- - parameters for the modified Roth-Erev learnining algorithmaPolicy
- - an existing policy containing and ActionDomain and possibly
previously learned knowledgeVRELearner
,
VREParameters
Method Detail |
---|
public SimpleAction<O> chooseAction()
chooseAction
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
Action
public O chooseActionRaw()
public int chooseActionIndex()
public void update(Feedback<java.lang.Double> reward)
update
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
reward
- - "reward" resulting from the learners last choice of action.public ReinforcementLearner getEngine()
public StatelessPolicy<java.lang.Integer,SimpleAction<O>> getPolicy()
ReinforcementLearner
getPolicy
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
StatelessPolicy
public void setPolicy(StatelessPolicy<java.lang.Integer,SimpleAction<O>> newPolicy)
setPolicy
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
newPolicy
- - new policy to useStatelessPolicy
public RLParameters getParameters()
getParameters
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
ReinforcementLearner.getParameters()
public RLParameters makeParameters()
makeParameters
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
ReinforcementLearner.makeParameters()
public void setParameters(RLParameters learnParams)
setParameters
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
ReinforcementLearner.setParameters(RLParameters)
public java.lang.String getName()
ReinforcementLearner
getName
in interface ReinforcementLearner<RLParameters,java.lang.Integer,SimpleAction<O>,Feedback<java.lang.Double>,StatelessPolicy<java.lang.Integer,SimpleAction<O>>>
ReinforcementLearner.getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |