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
-
lastRestartNumber
- the applet.restartNumber last time it was checked.
-
rnd
- PRNG for initial weights, scrambling data order, and other random choices
-
seed
- the random number seed
-
watchManager
- this experiment and all the objects it contains register vars with watchManager
-
wmName
- the prefix string for the name of every watched variable (passed in to setWatchManager)
-
Experiment()
-
-
BNF(int)
-
-
getName()
- Return the variable "name" that was passed into setWatchManager
-
getParameters(int)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
-
getWatchManager()
- Return the WatchManager set by setWatchManager().
-
initialize(int)
- Initialize, either partially or completely.
-
parse(Parser, int)
- Parse the input file to get the parameters for this object.
-
run()
- This runs the simulation.
-
setWatchManager(WatchManager, String)
- Register all variables with this WatchManager.
-
unparse(Unparser, int)
- Output a description of this object that can be parsed with parse().
lastRestartNumber
protected int lastRestartNumber
- the applet.restartNumber last time it was checked. If different now, then restart
watchManager
protected WatchManager watchManager
- this experiment and all the objects it contains register vars with watchManager
wmName
protected String wmName
- the prefix string for the name of every watched variable (passed in to setWatchManager)
seed
protected IntExp seed
- the random number seed
rnd
protected Random rnd
- PRNG for initial weights, scrambling data order, and other random choices
Experiment
public Experiment()
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.
getName
public String getName()
- Return the variable "name" that was passed into setWatchManager
getWatchManager
public WatchManager getWatchManager()
- Return the WatchManager set by setWatchManager().
getParameters
public Object[][] getParameters(int lang)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
- See Also:
- getParameters
BNF
public abstract String BNF(int lang)
unparse
public abstract void unparse(Unparser u,
int lang)
- Output a description of this object that can be parsed with parse().
- See Also:
- Parsable
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
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.
initialize
public void initialize(int level)
- Initialize, either partially or completely.
- See Also:
- initialize
All Packages Class Hierarchy This Package Previous Next Index