jasi.sim.user
Class Simulation

java.lang.Object
  extended by jasi.sim.basic.AbstractSimKernel
      extended by jasi.sim.user.Simulation
All Implemented Interfaces:
java.lang.Runnable

public final class Simulation
extends AbstractSimKernel

The simulation kernel. It is implemented as singleton by static creation of an kernel instance.


Field Summary
static java.lang.String ARC_FILE
          The simulation's default archive file name.
 
Constructor Summary
Simulation(SimController ctrl, AbstractSimArchive arc, SimListener out)
          Constructor of simulation.
 
Method Summary
static Simulation kernel()
          Get the instance of the simulation kernel.
 void run()
          Run simulation and execute all events.
 void setEndTime(Time endTime)
          Set a new ending time of this simulation.
 void setStartTime(Time startTime)
          Set a new starting time for the simulation.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class jasi.sim.basic.AbstractSimKernel
archive, calendar, continueSimulation, controller, currentTime, elements, finishSimulation, getInstance, init, initialize, isRunning, join, proxy, readArchive, start, startSimulation, stop, tables, writeArchive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ARC_FILE

public static final java.lang.String ARC_FILE
The simulation's default archive file name.

See Also:
Constant Field Values
Constructor Detail

Simulation

public Simulation(SimController ctrl,
                  AbstractSimArchive arc,
                  SimListener out)
Constructor of simulation.

Parameters:
ctrl - The simulation's controller.
arc - The simulation's archive.
out - The simulation's output module.
Method Detail

kernel

public static Simulation kernel()
Get the instance of the simulation kernel.

Returns:
The kernel instance.

setStartTime

public final void setStartTime(Time startTime)
Set a new starting time for the simulation.

Parameters:
startTime - The starting time.
Throws:
java.lang.IllegalStateException - If simulation is already running or not initialized.
java.lang.IllegalArgumentException - If the provided starting time is smaller (earlier) than the next event's or current starting time.

setEndTime

public final void setEndTime(Time endTime)
Set a new ending time of this simulation.

Parameters:
endTime - The new ending time.
Throws:
java.lang.IllegalStateException - If simulation is already running or not initialized.
java.lang.IllegalArgumentException - If the provided ending time is smaller (earlier) than the starting time.

run

public void run()
Run simulation and execute all events.


toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string.