All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sim.ForExperiment

java.lang.Object
   |
   +----sim.Experiment
           |
           +----sim.ForExperiment

public class ForExperiment
extends Experiment
This object sets up a series of experiments to be run. This object takes as its parameters the name of a variable to change in each experiment, the initial and final values of the variable, the increment, and the experiment to run.

This code is (c) 1996 Mance E. Harmon <harmonme@aa.wpafb.af.mil>, http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely. If the code is modified, please state so in the comments.

Version:
1.01, 1 July 97
Author:
Mance E. Harmon

Variable Index

 o experiment
This experiment to be run.
 o finalVal
the final value of the index
 o increment
the increment to the variable
 o index
this is used to graph the error vs.
 o initVal
the initial value of the index
 o variable
this name of the variable to used as the index

Constructor Index

 o ForExperiment()

Method Index

 o BNF(int)
 o initialize(int)
Initialize, either partially or completely.
 o parse(Parser, int)
Parse the input file to get the parameters for this object.
 o run()
This runs the simulation.
 o setWatchManager(WatchManager, String)
Register all variables with this WatchManager.
 o unparse(Unparser, int)
Output a description of this object that can be parsed with parse().

Variables

 o experiment
 protected Experiment experiment
This experiment to be run.

 o finalVal
 protected NumExp finalVal
the final value of the index

 o increment
 protected NumExp increment
the increment to the variable

 o initVal
 protected NumExp initVal
the initial value of the index

 o variable
 protected PString variable
this name of the variable to used as the index

 o index
 protected Pointer index
this is used to graph the error vs. index

Constructors

 o ForExperiment
 public ForExperiment()

Methods

 o setWatchManager
 public void setWatchManager(WatchManager wm,
                             String name)
Register all variables with this WatchManager. This will be called after all parsing is done. setWatchManager should be overridden and forced to call the same method on all the other objects in the experiment.

Overrides:
setWatchManager in class Experiment
 o BNF
 public String BNF(int lang)
Overrides:
BNF in class Experiment
 o unparse
 public void unparse(Unparser u,
                     int lang)
Output a description of this object that can be parsed with parse().

Overrides:
unparse in class Experiment
See Also:
Parsable
 o parse
 public Object parse(Parser p,
                     int lang) throws ParserException
Parse the input file to get the parameters for this object.

Throws: ParserException
parser didn't find the required token
Overrides:
parse in class Experiment
 o run
 public void run()
This runs the simulation. The function returns when the simulation is completely done. As the simulation is running, it should call the watchManager.update() function periodically so all the display windows can be updated.

Overrides:
run in class Experiment
 o initialize
 public void initialize(int level)
Initialize, either partially or completely.

Overrides:
initialize in class Experiment
See Also:
initialize

All Packages  Class Hierarchy  This Package  Previous  Next  Index