net.sourceforge.jabm.report
Class StrategyExecutionFrequency

java.lang.Object
  extended by net.sourceforge.jabm.event.AbstractModel
      extended by net.sourceforge.jabm.report.AbstractReportVariables
          extended by net.sourceforge.jabm.report.StrategyExecutionFrequency
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, EventListener, Model, Report, ReportVariables, XYReportVariables, org.springframework.beans.factory.InitializingBean

public class StrategyExecutionFrequency
extends AbstractReportVariables
implements org.springframework.beans.factory.InitializingBean

This class collects data on the frequency with which each strategy is executed.

See Also:
Strategy, Serialized Form
 

Field Summary
protected  Agent agent
          If agent is non-null then only track strategies executed by the specified agent.
protected  int agentIndex
           
protected  org.apache.commons.math3.stat.Frequency executionFrequency
           
protected  java.util.List<java.lang.String> keyList
           
static java.lang.String NAME
           
protected  Population population
           
 
Fields inherited from class net.sourceforge.jabm.report.AbstractReportVariables
name, simulation, timeStamp, xVariableName, yVariableNames
 
Fields inherited from class net.sourceforge.jabm.event.AbstractModel
deleteQueue, genericListeners, specificListeners
 
Constructor Summary
StrategyExecutionFrequency()
           
 
Method Summary
 void afterPropertiesSet()
           
 void compute(SimEvent event)
          Update variables.
 void eventOccurred(SimEvent event)
           
 int getAgentIndex()
           
 java.util.List getKeyList()
           
 int getNumberOfSeries()
           
 double getPercentage(java.lang.String tag)
           
 java.util.Map<java.lang.Object,java.lang.Number> getVariableBindings()
          Get the values calculated by this report.
 void initialise(SimEvent event)
          Initialise the variables in response to event.
 void onSimulationStarting(SimulationStartingEvent event)
           
 void onStrategyExecuted(StrategyExecutedEvent event)
           
 void setAgentIndex(int agentIndex)
          The index of a particular agent within the population whose strategy executions we want to track.
 void setKeyList(java.util.List keySetObjects)
          Configure the list of the strategies which this report will track.
 
Methods inherited from class net.sourceforge.jabm.report.AbstractReportVariables
createVariable, dispose, getName, getTimeStamp, getX, getxVariableName, getY, getyVariableNames, recordMoments, recordSummaryStatistics, setName, tag
 
Methods inherited from class net.sourceforge.jabm.event.AbstractModel
addListener, addListener, clearListeners, clone, fireEvent, notifyGenericListeners, notifySpecificListeners, processDeleteQueue, removeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

executionFrequency

protected org.apache.commons.math3.stat.Frequency executionFrequency

keyList

protected java.util.List<java.lang.String> keyList

agent

protected Agent agent
If agent is non-null then only track strategies executed by the specified agent.


population

protected Population population

agentIndex

protected int agentIndex

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

StrategyExecutionFrequency

public StrategyExecutionFrequency()
Method Detail

getVariableBindings

public java.util.Map<java.lang.Object,java.lang.Number> getVariableBindings()
Description copied from interface: Report
Get the values calculated by this report.

Specified by:
getVariableBindings in interface Report
Overrides:
getVariableBindings in class AbstractReportVariables
Returns:
A Map of user-readable variable names to their associated values.

getPercentage

public double getPercentage(java.lang.String tag)

eventOccurred

public void eventOccurred(SimEvent event)
Specified by:
eventOccurred in interface EventListener
Overrides:
eventOccurred in class AbstractReportVariables

onSimulationStarting

public void onSimulationStarting(SimulationStartingEvent event)

onStrategyExecuted

public void onStrategyExecuted(StrategyExecutedEvent event)

initialise

public void initialise(SimEvent event)
Description copied from interface: ReportVariables
Initialise the variables in response to event.

Specified by:
initialise in interface ReportVariables
Overrides:
initialise in class AbstractReportVariables

compute

public void compute(SimEvent event)
Description copied from interface: ReportVariables
Update variables.

Specified by:
compute in interface ReportVariables
Overrides:
compute in class AbstractReportVariables

getKeyList

public java.util.List getKeyList()

setKeyList

public void setKeyList(java.util.List keySetObjects)
Configure the list of the strategies which this report will track.

Parameters:
keySetObjects - The list of strategies which will be tracked. These can be object factories, object instances, or strings denoting the tag of a strategy.

getAgentIndex

public int getAgentIndex()

setAgentIndex

public void setAgentIndex(int agentIndex)
The index of a particular agent within the population whose strategy executions we want to track.

Parameters:
agentIndex -

getNumberOfSeries

public int getNumberOfSeries()
Specified by:
getNumberOfSeries in interface XYReportVariables
Overrides:
getNumberOfSeries in class AbstractReportVariables
Returns:
The number of independent variables.

afterPropertiesSet

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