RePast
v. 2.0

uchicago.src.sim.analysis
Class SequenceStatistic

java.lang.Object
  |
  +--jclass.chart.ChartDataSupport
        |
        +--uchicago.src.sim.analysis.Statistics
              |
              +--uchicago.src.sim.analysis.SequenceStatistic
All Implemented Interfaces:
jclass.chart.Chartable, jclass.chart.ChartData, Graphable, Serializable

public class SequenceStatistic
extends Statistics

The model for a SequenceGraph. This controls all the sequences used by a sequenceGraph.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class uchicago.src.sim.analysis.Statistics
CSV, data, fileFormat, fileName, lastColUpdate, lastPrinted, model, title
 
Fields inherited from interface jclass.chart.Chartable
ARRAY, GENERAL
 
Constructor Summary
SequenceStatistic(SimModel model)
          Construct this SequenceStatistic with the specified model
SequenceStatistic(String fileName, int fileFormat, String title, SimModel model)
          Constructs a SequenceStatistic with the specified title, file name, and file format, model.
 
Method Summary
 void addSequence(String name, Sequence sequence)
          Adds the specified sequence with the specified name.
 void createAverageSequence(String name, ArrayList feedFrom, String methodName)
          Creates an Average sequence with the specified name, using data from the specified list attained through the specified method name.
 void createSequence(String name, Object feedFrom, String methodName)
          Creates a sequence with the specified name, using data from the specified object attained through the specified method name.
 void record()
          Calculates the next item in the sequence
 void step()
          Calculates the next item in the sequence and tells the chart to update itself.
 void writeToFile()
          Writes the sequence out to a file
 
Methods inherited from class uchicago.src.sim.analysis.Statistics
addChartAsListener, getDataInterpretation, getDataItem, getDataTable, getName, getNumRows, getPointLabels, getRow, getSeriesLabel, getSeriesName, renameFile, setSimModel, updateGraph
 
Methods inherited from class jclass.chart.ChartDataSupport
addChartDataListener, fireChartDataEvent, fireChartDataEvent, removeChartDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceStatistic

public SequenceStatistic(SimModel model)
Construct this SequenceStatistic with the specified model


SequenceStatistic

public SequenceStatistic(String fileName,
                         int fileFormat,
                         String title,
                         SimModel model)
Constructs a SequenceStatistic with the specified title, file name, and file format, model.

Parameters:
fileName - the name of the file to write the sequence data to
fileFormat - the format of the file - i.e. Statistics.CSV
title - the title
model - the model
Method Detail

createSequence

public void createSequence(String name,
                           Object feedFrom,
                           String methodName)
Creates a sequence with the specified name, using data from the specified object attained through the specified method name.

Parameters:
name - of the sequence
feedFrom - the object from which to collect the sequence data
methodName - the name of the method to call on the object to get the data. This method must return a number (int etc.) or a Number (Integer etc.)

addSequence

public void addSequence(String name,
                        Sequence sequence)
Adds the specified sequence with the specified name.

Parameters:
name - the name of the sequence
sequence - the sequence to add

createAverageSequence

public void createAverageSequence(String name,
                                  ArrayList feedFrom,
                                  String methodName)
Creates an Average sequence with the specified name, using data from the specified list attained through the specified method name. Each object in the list has the named method called on it, the resulting data is averaged, and this average constitutes the data for the sequence.

Parameters:
name - of the sequence
feedFrom - the list from which to collect the sequence data
methodName - the name of the method to call on the object to get the data. This method must return a number (int etc.) or a Number (Integer etc.)

step

public void step()
Calculates the next item in the sequence and tells the chart to update itself.

Specified by:
step in class Statistics

record

public void record()
Calculates the next item in the sequence

Specified by:
record in class Statistics

writeToFile

public void writeToFile()
Writes the sequence out to a file

Specified by:
writeToFile in class Statistics

RePast
v. 2.0

Bug reports and feature requests to RePast