|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iastate.jrelm.core.SimpleActionDomain<O>
O
- - This is the original type of action Objects in
the given collection.public class SimpleActionDomain<O>
SimpleActionDomain is basic implementation of the ActionDomain interface. This no-frills domain is essentially built around an ArrayList of SimpleActions that wrap a given collection of Objects that represent action choices.
This domain builds itself from a given collection of Objects. Each Object is considered to represent a choice of action and the Collection the list of all possible actions an ReinforcementLearner can choose from. Internally, each Object is wrapped in SimpleAction and the space of possible actions is organized by Integer index. The use of SimpleAction wrappers allow the domain to be used with other learning components (i.e. ReinforcementLearner, StatelessPolicy).
Constructor Summary | |
---|---|
SimpleActionDomain(java.util.Collection<O> actions)
Build a domain from the given collection of Objects. |
Method Summary | |
---|---|
boolean |
containsAction(SimpleAction<O> actionToCheck)
Determines if the given Action is in this domain. |
SimpleAction<O> |
getAction(int actionIndex)
Convenience method to allow actions to be retrieved with an int id. |
SimpleAction<O> |
getAction(java.lang.Integer id)
Retrieves the Action indicated by the id object. |
java.util.ArrayList<java.lang.Integer> |
getIDList()
Retrieve a list of the identifiers for all Actions in this domain. |
int |
size()
Reports the number of Actions in this domain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleActionDomain(java.util.Collection<O> actions)
actions
- - list of objects specifying actions.Method Detail |
---|
public boolean containsAction(SimpleAction<O> actionToCheck)
ActionDomain
containsAction
in interface ActionDomain<java.lang.Integer,SimpleAction<O>>
ActionDomain
public SimpleAction<O> getAction(java.lang.Integer id)
ActionDomain
getAction
in interface ActionDomain<java.lang.Integer,SimpleAction<O>>
id
- - identifier indicating the desired Action
ActionDomain
public SimpleAction<O> getAction(int actionIndex)
actionIndex
- - int index of the desired action in the domain
public int size()
ActionDomain
size
in interface ActionDomain<java.lang.Integer,SimpleAction<O>>
edu.iastate.jrelm.core.DiscreteFiniteDomain
public java.util.ArrayList<java.lang.Integer> getIDList()
ActionDomain
getIDList
in interface ActionDomain<java.lang.Integer,SimpleAction<O>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |