|
||||||||||
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
public abstract class Simulator
The Simulator class is an abstract implementation of the SimulatorInterface.
(c) copyright 2002-2005 Delft
University of Technology , the Netherlands.
See for project information
www.simulation.tudelft.nl
License of use: Lesser
General Public License (LGPL) , 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 Object |
semaphore
the simulatorSemaphore |
protected double |
simulatorTime
simulatorTime represents the simulationTime |
protected 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 transient boolean running
protected Replication replication
protected transient WorkerThread worker
protected transient 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 RemoteException, SimRuntimeException
SimulatorInterface
initialize
in interface SimulatorInterface
replication
- the replication
RemoteException
- on network failure
SimRuntimeException
- on simulator failure (simulator is running)#initialize(Replication)
public boolean isRunning()
SimulatorInterface
isRunning
in interface SimulatorInterface
SimulatorInterface.isRunning()
public abstract void run()
run
in interface Runnable
public void start() throws SimRuntimeException
SimulatorInterface
start
in interface SimulatorInterface
SimRuntimeException
- whenever starting fails. Possible occasions
include starting a started simulatorSimulatorInterface.start()
public void step() throws SimRuntimeException
SimulatorInterface
step
in interface SimulatorInterface
SimRuntimeException
- whenever stepping fails. Possible occasions
include stepping a stopped simulatorSimulatorInterface.step()
public void stop()
SimulatorInterface
stop
in interface SimulatorInterface
SimulatorInterface.stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |