uchicago.src.sim.analysis
Class OpenSeqStatistic

java.lang.Object
  extended by uchicago.src.sim.analysis.PlotModel
      extended by uchicago.src.sim.analysis.OpenSeqStatistic

public class OpenSeqStatistic
extends PlotModel

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

Version:
$Revision: 1.8 $ $Date: 2004/11/03 19:51:00 $
Author:
Nick Collier

Field Summary
 
Fields inherited from class uchicago.src.sim.analysis.PlotModel
CSV, fileFormat, fileName, lastColUpdate, model, title
 
Constructor Summary
OpenSeqStatistic(SimModel model)
          Construct this SequenceStatistic with the specified model
OpenSeqStatistic(java.lang.String fileName, int fileFormat, java.lang.String title, SimModel model)
          Constructs a SequenceStatistic with the specified title, file name, and file format, model.
 
Method Summary
 Sequence addSequence(java.lang.String name, Sequence sequence)
          Adds the specified sequence with the specified name.
 Sequence createAverageSequence(java.lang.String name, java.util.ArrayList feedFrom, java.lang.String methodName)
          Creates an Average sequence with the specified name, using data from the specified list attained through the specified method name.
 Sequence createSequence(java.lang.String name, java.lang.Object feedFrom, java.lang.String methodName)
          Creates a sequence with the specified name, using data from the specified object attained through the specified method name.
 double getYVal(int sequenceIndex, int xIndex)
           
 void record()
          Calculates the next item in the sequence
 void writeToFile()
          Writes the sequence out to a file
 
Methods inherited from class uchicago.src.sim.analysis.PlotModel
addSequence, addX, addY, getSequenceCount, getSequenceNames, getXVal, getXValCount, renameFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenSeqStatistic

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


OpenSeqStatistic

public OpenSeqStatistic(java.lang.String fileName,
                        int fileFormat,
                        java.lang.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 Sequence createSequence(java.lang.String name,
                               java.lang.Object feedFrom,
                               java.lang.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 Sequence addSequence(java.lang.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 Sequence createAverageSequence(java.lang.String name,
                                      java.util.ArrayList feedFrom,
                                      java.lang.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.)

getYVal

public double getYVal(int sequenceIndex,
                      int xIndex)
Overrides:
getYVal in class PlotModel

record

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

Specified by:
record in class PlotModel

writeToFile

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

Specified by:
writeToFile in class PlotModel