net.sourceforge.jabm.report
Class AbstractReportVariables

java.lang.Object
  extended by net.sourceforge.jabm.event.AbstractModel
      extended by net.sourceforge.jabm.report.AbstractReportVariables
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, EventListener, Model, Report, ReportVariables, XYReportVariables
Direct Known Subclasses:
FitnessReportVariables, PayoffByStrategyReportVariables, RandomVariateReportVariables, StrategyExecutionFrequency, SummaryStatisticsReportVariables, WeightedGraphMetrics

public abstract class AbstractReportVariables
extends AbstractModel
implements XYReportVariables

See Also:
Serialized Form
 

Field Summary
protected  java.lang.String name
           
protected  Simulation simulation
           
protected  long timeStamp
           
protected  java.lang.String xVariableName
           
protected  java.util.List<java.lang.Object> yVariableNames
           
 
Fields inherited from class net.sourceforge.jabm.event.AbstractModel
deleteQueue, genericListeners, specificListeners
 
Constructor Summary
AbstractReportVariables(java.lang.String name)
           
 
Method Summary
 void compute(SimEvent event)
          Update variables.
 java.lang.Object createVariable(java.lang.String variableName)
           
 void dispose(SimEvent event)
          Clean up any side effects (eg close file).
 void eventOccurred(SimEvent event)
           
 java.lang.String getName()
           
 int getNumberOfSeries()
           
 long getTimeStamp()
           
 java.util.Map<java.lang.Object,java.lang.Number> getVariableBindings()
          Get the values calculated by this report.
 java.lang.Number getX(int seriesIndex)
           
 java.lang.String getxVariableName()
           
 java.lang.Number getY(int seriesIndex)
           
 java.util.List<java.lang.Object> getyVariableNames()
           
 void initialise(SimEvent event)
          Initialise the variables in response to event.
 void recordMoments(java.lang.Object statName, java.util.Map<java.lang.Object,java.lang.Number> variables, org.apache.commons.math3.stat.descriptive.SummaryStatistics stats)
           
 void recordSummaryStatistics(java.lang.Object statName, java.util.Map<java.lang.Object,java.lang.Number> variables, org.apache.commons.math3.stat.descriptive.SummaryStatistics stats)
           
 void setName(java.lang.String name)
           
 java.lang.String tag(java.lang.Object strategy)
           
 
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

timeStamp

protected long timeStamp

name

protected java.lang.String name

xVariableName

protected java.lang.String xVariableName

yVariableNames

protected java.util.List<java.lang.Object> yVariableNames

simulation

protected Simulation simulation
Constructor Detail

AbstractReportVariables

public AbstractReportVariables(java.lang.String name)
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
Returns:
A Map of user-readable variable names to their associated values.

createVariable

public java.lang.Object createVariable(java.lang.String variableName)

recordMoments

public void recordMoments(java.lang.Object statName,
                          java.util.Map<java.lang.Object,java.lang.Number> variables,
                          org.apache.commons.math3.stat.descriptive.SummaryStatistics stats)

recordSummaryStatistics

public void recordSummaryStatistics(java.lang.Object statName,
                                    java.util.Map<java.lang.Object,java.lang.Number> variables,
                                    org.apache.commons.math3.stat.descriptive.SummaryStatistics stats)

compute

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

Specified by:
compute in interface ReportVariables

getName

public java.lang.String getName()
Specified by:
getName in interface Report
Specified by:
getName in interface ReportVariables

setName

public void setName(java.lang.String name)

getTimeStamp

public long getTimeStamp()

eventOccurred

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

dispose

public void dispose(SimEvent event)
Description copied from interface: ReportVariables
Clean up any side effects (eg close file).

Specified by:
dispose in interface ReportVariables

initialise

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

Specified by:
initialise in interface ReportVariables

getX

public java.lang.Number getX(int seriesIndex)
Specified by:
getX in interface XYReportVariables

getY

public java.lang.Number getY(int seriesIndex)
Specified by:
getY in interface XYReportVariables
Parameters:
seriesIndex - The index of the dependent variable.
Returns:
The value of the dependent variable in the given series.

getxVariableName

public java.lang.String getxVariableName()
Specified by:
getxVariableName in interface XYReportVariables
Returns:
The name of the independent variable.

getyVariableNames

public java.util.List<java.lang.Object> getyVariableNames()
Specified by:
getyVariableNames in interface XYReportVariables
Returns:
The names of the dependent variables.

getNumberOfSeries

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

tag

public java.lang.String tag(java.lang.Object strategy)