public abstract class RlStrategyWithState extends AbstractRlStrategy implements Serializable, org.springframework.beans.factory.InitializingBean, Taggable
Modifier and Type | Field and Description |
---|---|
protected MDPLearner |
learner |
actions, currentStrategy, initialPropensities, strategyFactory
agent, scheduler
Constructor and Description |
---|
RlStrategyWithState() |
RlStrategyWithState(Agent agent,
org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory,
MDPLearner learner) |
RlStrategyWithState(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory,
MDPLearner learner) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Strategy |
clone() |
void |
execute(List<Agent> otherAgents)
Execute the behaviour defined by this strategy.
|
double[] |
getInitialPropensities() |
MDPLearner |
getLearner() |
int |
getNumberOfActions() |
abstract int |
getState() |
org.springframework.beans.factory.ObjectFactory<Strategy> |
getStrategyFactory() |
String |
getTag() |
void |
setAgent(Agent agent)
Configure the agent associated with this strategy.
|
void |
setInitialPropensities(double[] initialPropensities) |
void |
setLearner(MDPLearner learner) |
void |
setStrategyFactory(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory) |
void |
setTag(String tag) |
void |
subscribeToEvents(EventScheduler scheduler)
A Strategy should subscribe to any events it wants to receive by calling
the
addListener method in the EventScheduler class. |
void |
unsubscribeFromEvents()
The strategy should call
EventScheduler.removeListener()
to unsubscribe from events when this method is called. |
initialise
eventOccurred, fireEvent, getAgent, getScheduler, onSimulationFinished, setScheduler, subscribeToEvents
protected MDPLearner learner
public RlStrategyWithState(Agent agent, org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory, MDPLearner learner)
public RlStrategyWithState(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory, MDPLearner learner)
public RlStrategyWithState()
public void subscribeToEvents(EventScheduler scheduler)
Strategy
addListener
method in the EventScheduler
class.subscribeToEvents
in interface Strategy
subscribeToEvents
in class AbstractStrategy
scheduler
- The EventScheduler
on which to listen.public void execute(List<Agent> otherAgents)
Strategy
execute
in interface Strategy
execute
in class AbstractStrategy
otherAgents
- The other agents with which the agent associated
with this strategy is interacting.public MDPLearner getLearner()
public void setLearner(MDPLearner learner)
public void setAgent(Agent agent)
Strategy
setAgent
in interface Strategy
setAgent
in class AbstractStrategy
public Strategy clone() throws CloneNotSupportedException
clone
in interface Strategy
clone
in class AbstractStrategy
CloneNotSupportedException
public void unsubscribeFromEvents()
Strategy
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.unsubscribeFromEvents
in interface Strategy
unsubscribeFromEvents
in class AbstractRlStrategy
public org.springframework.beans.factory.ObjectFactory<Strategy> getStrategyFactory()
getStrategyFactory
in class AbstractRlStrategy
public void setStrategyFactory(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory)
setStrategyFactory
in class AbstractRlStrategy
public double[] getInitialPropensities()
getInitialPropensities
in class AbstractRlStrategy
public void setInitialPropensities(double[] initialPropensities)
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public int getNumberOfActions()
getNumberOfActions
in class AbstractRlStrategy
public abstract int getState()
Copyright © 2014. All rights reserved.