|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnl.tudelft.simulation.event.EventProducer
nl.tudelft.simulation.dsol.simulators.Simulator
The Simulator class is an abstract implementation of the SimulatorInterface.
(c) copyright 2003 Delft
University of Technology , the Netherlands.
See for project information
www.simulation.tudelft.nl
License of use: General Public
License (GPL) , no warranty
| Field Summary | |
protected Replication |
replication
replication represents the currently active replication |
protected boolean |
running
running represents the binary state of the simulator |
protected java.lang.Object |
semaphore
the simulatorSemaphore |
protected double |
simulatorTime
simulatorTime represents the simulationTime |
protected nl.tudelft.simulation.language.concurrent.WorkerThread |
worker
a worker |
| Fields inherited from class nl.tudelft.simulation.event.EventProducer |
listeners |
| Fields inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface |
END_OF_REPLICATION_EVENT, START_EVENT, START_REPLICATION_EVENT, STEP_EVENT, STOP_EVENT, TIME_CHANGED_EVENT, WARMUP_EVENT |
| Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface |
FIRST_POSITION, LAST_POSITION |
| Constructor Summary | |
Simulator()
constructs a new Simulator |
|
| Method Summary | |
Replication |
getReplication()
returns the currently executed replication. |
double |
getSimulatorTime()
returns the actual simulator time. |
void |
initialize(Replication replication)
initializes the simulator with a specified replication. |
boolean |
isRunning()
is the simulator running. |
abstract void |
run()
The run method defines the actual time step mechanism of the simulator. |
void |
start()
starts the simulator |
void |
step()
steps the simulator. |
void |
stop()
stops the simulator. |
| Methods inherited from class nl.tudelft.simulation.event.EventProducer |
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface |
addListener, addListener, addListener, addListener, getEventTypes, removeListener |
| Field Detail |
protected double simulatorTime
protected boolean running
protected Replication replication
protected nl.tudelft.simulation.language.concurrent.WorkerThread worker
protected java.lang.Object semaphore
| Constructor Detail |
public Simulator()
| Method Detail |
public double getSimulatorTime()
SimulatorInterface
getSimulatorTime in interface SimulatorInterface#getSimulatorTime()public Replication getReplication()
SimulatorInterface
getReplication in interface SimulatorInterface#getReplication()
public void initialize(Replication replication)
throws java.rmi.RemoteException,
SimRuntimeException
SimulatorInterface
initialize in interface SimulatorInterfacereplication - the replication
java.rmi.RemoteException - on network failure
SimRuntimeException - on simulator failure (simulator is running)#initialize(Replication)public boolean isRunning()
SimulatorInterface
isRunning in interface SimulatorInterfaceSimulatorInterface.isRunning()public abstract void run()
run in interface java.lang.Runnable
public void start()
throws SimRuntimeException,
java.rmi.RemoteException
SimulatorInterface
start in interface SimulatorInterfacejava.rmi.RemoteException - on network failure
SimRuntimeException - whenever starting fails. Possible occasions
include starting a started simulatorSimulatorInterface.start()
public void step()
throws SimRuntimeException
SimulatorInterface
step in interface SimulatorInterfaceSimRuntimeException - whenever stepping fails. Possible occasions
include stepping a stopped simulatorSimulatorInterface.step()public void stop()
SimulatorInterface
stop in interface SimulatorInterfaceSimulatorInterface.stop()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||