RePast
v. 2.0

uchicago.src.sim.analysis
Class PlotModel

java.lang.Object
  |
  +--uchicago.src.sim.analysis.PlotModel
Direct Known Subclasses:
OpenSeqStatistic

public abstract class PlotModel
extends Object


Field Summary
static int CSV
           
protected  int fileFormat
           
protected  String fileName
           
protected  int lastColUpdate
           
protected  SimModel model
           
protected  String title
           
 
Constructor Summary
PlotModel(SimModel model)
          Construct a Statistics class with the specified model
PlotModel(String fileName, int fileFormat, String title, SimModel model)
          Constructs a Statistic with the specified title, file name, and file format, and model.
 
Method Summary
 void addSequence(String name)
           
 void addX(double xVal)
           
 void addY(double yVal, int yIndex)
           
 int getSequenceCount()
           
 ArrayList getSequenceNames()
           
 double getXVal(int xIndex)
           
 int getXValCount()
           
 double getYVal(int sequenceIndex, int index)
           
abstract  void record()
          Calculates the next item in the sequence
protected  void renameFile()
           
abstract  void writeToFile()
          Writes the data stored by this call to a file specified in the constructor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CSV

public static final int CSV
See Also:
Constant Field Values

fileName

protected String fileName

fileFormat

protected int fileFormat

title

protected String title

model

protected SimModel model

lastColUpdate

protected int lastColUpdate
Constructor Detail

PlotModel

public PlotModel(SimModel model)
Construct a Statistics class with the specified model


PlotModel

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

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

addSequence

public void addSequence(String name)

getSequenceNames

public ArrayList getSequenceNames()

addX

public void addX(double xVal)

addY

public void addY(double yVal,
                 int yIndex)

getXVal

public double getXVal(int xIndex)

getYVal

public double getYVal(int sequenceIndex,
                      int index)

getSequenceCount

public int getSequenceCount()

getXValCount

public int getXValCount()

record

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


renameFile

protected void renameFile()
                   throws IOException
IOException

writeToFile

public abstract void writeToFile()
Writes the data stored by this call to a file specified in the constructor


RePast
v. 2.0

Bug reports and feature requests to RePast