|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iastate.jrelm.core.SimpleStateDomain<O>
O
- - This is the original type of state Objects in
the given collection.public class SimpleStateDomain<O>
SimpleStateDomain is basic implementation of the StateDomain interface. This no-frills domain is essentially built around an ArrayList of SimpleStates that wrap a given collection of Objects that represent state choices.
This domain builds itself from a given collection of Objects. Each Object is considered to represent a state of the environment external to the ReinforcementLearning (or agent). The Collection is the list of all possible states an ReinforcementLearner may encounter. Internally, each Object is wrapped in SimpleState and the space of possible states is organized by Integer index. The use of SimpleState wrappers allow the domain to be used with other learning components (i.e. ReinforcementLearners that implement stateful learning algorithms).
Note, this class is only appropriate for contexts where the set of all possible states is discrete and finite.
Constructor Summary | |
---|---|
SimpleStateDomain(java.util.Collection<O> states)
Build a domain from the given collection of Objects. |
Method Summary | |
---|---|
boolean |
containsState(SimpleState<O> stateToCheck)
Determines if the given Action is in this domain. |
java.util.ArrayList<java.lang.Integer> |
getIDList()
Retrieve a list of the identifiers for all States in this domain. |
SimpleState<O> |
getState(int stateIndex)
Convenience method to allow states to be retrieved with an int id. |
SimpleState<O> |
getState(java.lang.Integer id)
Retrieves the State indicated by the id object. |
int |
size()
Reports the number of States in this domain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleStateDomain(java.util.Collection<O> states)
states
- - list of objects specifying states.Method Detail |
---|
public boolean containsState(SimpleState<O> stateToCheck)
StateDomain
containsState
in interface StateDomain<java.lang.Integer,SimpleState<O>>
StateDomain
public SimpleState<O> getState(java.lang.Integer id)
StateDomain
getState
in interface StateDomain<java.lang.Integer,SimpleState<O>>
id
- - identifier indicating the desired State
StateDomain
public SimpleState<O> getState(int stateIndex)
stateIndex
- - int index of the desired state in the domain
public int size()
StateDomain
size
in interface StateDomain<java.lang.Integer,SimpleState<O>>
edu.iastate.jrelm.core.DiscreteFiniteDomain
public java.util.ArrayList<java.lang.Integer> getIDList()
StateDomain
getIDList
in interface StateDomain<java.lang.Integer,SimpleState<O>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |