net.sourceforge.jabm.strategy
Class RlStrategyWithState
java.lang.Object
net.sourceforge.jabm.strategy.AbstractStrategy
net.sourceforge.jabm.strategy.AbstractRlStrategy
net.sourceforge.jabm.strategy.RlStrategyWithState
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, EventListener, Taggable, Strategy, org.springframework.beans.factory.InitializingBean
public abstract class RlStrategyWithState
- extends AbstractRlStrategy
- implements java.io.Serializable, org.springframework.beans.factory.InitializingBean, Taggable
- See Also:
- Serialized Form
-
-
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
learner
protected MDPLearner learner
RlStrategyWithState
public RlStrategyWithState(Agent agent,
org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory,
MDPLearner learner)
RlStrategyWithState
public RlStrategyWithState(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory,
MDPLearner learner)
RlStrategyWithState
public RlStrategyWithState()
subscribeToEvents
public void subscribeToEvents(EventScheduler scheduler)
- Description copied from interface:
Strategy
- A Strategy should subscribe to any events it wants to receive by calling
the
addListener
method in the EventScheduler
class.
- Specified by:
subscribeToEvents
in interface Strategy
- Overrides:
subscribeToEvents
in class AbstractStrategy
- Parameters:
scheduler
- The EventScheduler
on which to listen.
execute
public void execute(java.util.List<Agent> otherAgents)
- Description copied from interface:
Strategy
- Execute the behaviour defined by this strategy.
- Specified by:
execute
in interface Strategy
- Overrides:
execute
in class AbstractStrategy
- Parameters:
otherAgents
- The other agents with which the agent associated
with this strategy is interacting.
getLearner
public MDPLearner getLearner()
setLearner
public void setLearner(MDPLearner learner)
setAgent
public void setAgent(Agent agent)
- Description copied from interface:
Strategy
- Configure the agent associated with this strategy.
- Specified by:
setAgent
in interface Strategy
- Overrides:
setAgent
in class AbstractStrategy
clone
public Strategy clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone
in interface Strategy
- Overrides:
clone
in class AbstractStrategy
- Throws:
java.lang.CloneNotSupportedException
unsubscribeFromEvents
public void unsubscribeFromEvents()
- Description copied from interface:
Strategy
- The strategy should call
EventScheduler.removeListener()
to unsubscribe from events when this method is called. This hook is
used to clean-up, for example when the strategy is disposed of.
- Specified by:
unsubscribeFromEvents
in interface Strategy
- Overrides:
unsubscribeFromEvents
in class AbstractRlStrategy
getStrategyFactory
public org.springframework.beans.factory.ObjectFactory<Strategy> getStrategyFactory()
- Overrides:
getStrategyFactory
in class AbstractRlStrategy
setStrategyFactory
public void setStrategyFactory(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory)
- Overrides:
setStrategyFactory
in class AbstractRlStrategy
getInitialPropensities
public double[] getInitialPropensities()
- Overrides:
getInitialPropensities
in class AbstractRlStrategy
setInitialPropensities
public void setInitialPropensities(double[] initialPropensities)
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
getTag
public java.lang.String getTag()
- Specified by:
getTag
in interface Taggable
setTag
public void setTag(java.lang.String tag)
- Specified by:
setTag
in interface Taggable
getNumberOfActions
public int getNumberOfActions()
- Specified by:
getNumberOfActions
in class AbstractRlStrategy
getState
public abstract int getState()