All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sim.Experiment

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

public abstract class Experiment
extends Object
implements Parsable, Watchable
All experiments extend this abstract class. This object parses and loads in all the necessary function approximators, data objects, models, optimizing, and learning algorithms to run an experiment. The Simulator takes care of hooking up the displays and managing the user interface to create new displays. If the Experiment gets its parameters from the file it's parsing, and if it loads in function approximators etc with parseType, then a single Experiment class can run a wide range of experiments.

This code is (c) 1996 Leemon Baird <leemon@cs.cmu.edu>, 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.0, 25 June 96
Author:
Leemon Baird

Variable Index

 o lastRestartNumber
the applet.restartNumber last time it was checked.
 o rnd
PRNG for initial weights, scrambling data order, and other random choices
 o seed
the random number seed
 o watchManager
this experiment and all the objects it contains register vars with watchManager
 o wmName
the prefix string for the name of every watched variable (passed in to setWatchManager)

Constructor Index

 o Experiment()

Method Index

 o BNF(int)
 o getName()
Return the variable "name" that was passed into setWatchManager
 o getParameters(int)
Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
 o getWatchManager()
Return the WatchManager set by setWatchManager().
 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 lastRestartNumber
 protected int lastRestartNumber
the applet.restartNumber last time it was checked. If different now, then restart

 o watchManager
 protected WatchManager watchManager
this experiment and all the objects it contains register vars with watchManager

 o wmName
 protected String wmName
the prefix string for the name of every watched variable (passed in to setWatchManager)

 o seed
 protected IntExp seed
the random number seed

 o rnd
 protected Random rnd
PRNG for initial weights, scrambling data order, and other random choices

Constructors

 o Experiment
 public Experiment()

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.

 o getName
 public String getName()
Return the variable "name" that was passed into setWatchManager

 o getWatchManager
 public WatchManager getWatchManager()
Return the WatchManager set by setWatchManager().

 o getParameters
 public Object[][] getParameters(int lang)
Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.

See Also:
getParameters
 o BNF
 public abstract String BNF(int lang)
 o unparse
 public abstract void unparse(Unparser u,
                              int lang)
Output a description of this object that can be parsed with parse().

See Also:
Parsable
 o parse
 public abstract 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
 o run
 public abstract 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.

 o initialize
 public void initialize(int level)
Initialize, either partially or completely.

See Also:
initialize

All Packages  Class Hierarchy  This Package  Previous  Next  Index