public abstract class SimTreeApplication
extends java.lang.Object
SimTree applications. Applications derived from
this class support the following command line arguments:
-s seed-n numberOfBatches0, the simulation is not
run at all.-p parsim.par)-f fmt-l logsim.log). If the log file is
none, no results are written.-b batchLog(s)default, the default batch logs are created.-e exportLog(s)default, the default export logs are created.-i importLog(s)-g parseLog-t testLog-z compression type-c calendar typeA typical application may be started like this:
public static void main(String[] args) {
SimTreeApplication app = new MyApp(args);
app.run();
}
Applications have to implement the createModel method to provide
the simulation model. Further control over the application components is
given to deriving classes by the createCalendar,
createSystemRNG and createSimulation methods, which
have sensible default implementations.
The constructor might exit the VM with System.exit to be
compatible to the SimTree semantics.
The SimTreeApplication can also be executed directly from the
command line. It requires the class name of the model as first argument. The
model constructor must look like this:
MyModel(ParseEnvrionment env)
SimulationEnvironment| Modifier and Type | Field and Description |
|---|---|
protected Model |
model
Simulation model.
|
protected SimulationEnvironment |
simEnvironment
Simulation environment for the default simulations.
|
protected Simulation |
simulation
The simulation.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SimTreeApplication()
Creates a new
SimTree application. |
protected |
SimTreeApplication(java.lang.String name,
java.lang.String[] args)
Creates a new
SimTree application. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createCalendar(java.lang.String name)
Creates the calendar for the simulation.
|
protected Simulation |
createImportSimulation()
Creates the import simulation.
|
protected abstract Model |
createModel(Parameters pars)
Creates the model for the simulation.
|
protected Simulation |
createSimulation()
Creates the simulation.
|
protected RandomNumberGenerator |
createSystemRNG()
Creates the system RNG.
|
protected void |
init(java.lang.String name,
java.lang.String[] args)
Parses the arguments and creates the simulation environment.
|
void |
run()
Runs the simulation.
|
protected SimulationEnvironment simEnvironment
protected Model model
protected Simulation simulation
createSimulation or
createImportSimulation.protected SimTreeApplication()
SimTree application. This constructor is solely
used by deriving applications which have to call init
themselves.protected SimTreeApplication(java.lang.String name,
java.lang.String[] args)
SimTree application. This constructor might
exit the VM with System.exit to adhere to the
SimTree semantics.name - of the SimTree applicationargs - command line argumentsprotected void init(java.lang.String name,
java.lang.String[] args)
System.exit to adhere to the
SimTree semantics.protected abstract Model createModel(Parameters pars)
calendar field is
initialized before this method is called.pars - an object representing the entire parameter treeprotected void createCalendar(java.lang.String name)
protected RandomNumberGenerator createSystemRNG()
StdRandomNumberGenerator
is returned.protected Simulation createSimulation()
StdSimulation is
returned.protected Simulation createImportSimulation()
ImportSimulation
is returned.public void run()