net.sourceforge.jabm.strategy
Class RlStrategy

java.lang.Object
  extended by net.sourceforge.jabm.strategy.AbstractStrategy
      extended by net.sourceforge.jabm.strategy.AbstractRlStrategy
          extended by net.sourceforge.jabm.strategy.RlStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, EventListener, Taggable, Strategy, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
RlStrategyWithImitation

public class RlStrategy
extends AbstractRlStrategy
implements java.io.Serializable, org.springframework.beans.factory.InitializingBean, Taggable

See Also:
Serialized Form
 

Field Summary
protected  StimuliResponseLearner learner
           
 
Fields inherited from class net.sourceforge.jabm.strategy.AbstractRlStrategy
actions, currentStrategy, initialPropensities, strategyFactory
 
Fields inherited from class net.sourceforge.jabm.strategy.AbstractStrategy
agent, scheduler
 
Constructor Summary
RlStrategy()
           
RlStrategy(Agent agent, org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory, StimuliResponseLearner learner)
           
RlStrategy(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory, StimuliResponseLearner learner)
           
 
Method Summary
 void afterPropertiesSet()
           
 Strategy clone()
           
 void execute(java.util.List<Agent> otherAgents)
          Execute the behaviour defined by this strategy.
 StimuliResponseLearner getLearner()
           
 int getNumberOfActions()
           
 java.lang.String getTag()
           
 void initialise()
           
 void setAgent(Agent agent)
          Configure the agent associated with this strategy.
 void setInitialPropensities(double[] initialPropensities)
           
 void setLearner(StimuliResponseLearner learner)
           
 void setTag(java.lang.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.
 
Methods inherited from class net.sourceforge.jabm.strategy.AbstractRlStrategy
getInitialPropensities, getStrategyFactory, setStrategyFactory, unsubscribeFromEvents
 
Methods inherited from class net.sourceforge.jabm.strategy.AbstractStrategy
eventOccurred, fireEvent, getAgent, getScheduler, onSimulationFinished, setScheduler, subscribeToEvents
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

learner

protected StimuliResponseLearner learner
Constructor Detail

RlStrategy

public RlStrategy(Agent agent,
                  org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory,
                  StimuliResponseLearner learner)

RlStrategy

public RlStrategy(org.springframework.beans.factory.ObjectFactory<Strategy> strategyFactory,
                  StimuliResponseLearner learner)

RlStrategy

public RlStrategy()
Method Detail

initialise

public void initialise()
Overrides:
initialise in class AbstractRlStrategy

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 StimuliResponseLearner getLearner()

setLearner

public void setLearner(StimuliResponseLearner 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

setInitialPropensities

public void setInitialPropensities(double[] initialPropensities)

getNumberOfActions

public int getNumberOfActions()
Specified by:
getNumberOfActions in class AbstractRlStrategy

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

setTag

public void setTag(java.lang.String tag)
Specified by:
setTag in interface Taggable

getTag

public java.lang.String getTag()
Specified by:
getTag in interface Taggable