|
||||||||||
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
nl.tudelft.simulation.dsol.simulators.DEVSSimulator
public class DEVSSimulator
The DEVS defines the interface of the DEVS simulator. DEVS stands for the Discrete Event System Specification. More information on Discrete Event Simulation can be found in "Theory of Modeling and Simulation" by Bernard Zeigler et. al.
(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 EventListInterface |
eventList
eventList represents the future event list |
Fields inherited from class nl.tudelft.simulation.dsol.simulators.Simulator |
---|
replication, running, semaphore, simulatorTime, worker |
Fields inherited from class nl.tudelft.simulation.event.EventProducer |
---|
listeners |
Fields inherited from interface nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface |
---|
EVENTLIST_CHANGED_EVENT |
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 | |
---|---|
DEVSSimulator()
|
Method Summary | |
---|---|
boolean |
cancelEvent(SimEventInterface event)
cancels an event from the event list. |
protected void |
endReplication()
the end of replication method, triggered by a special SimEvent |
EventListInterface |
getEventList()
returns the eventlist of the simulator. |
void |
initialize(Replication replication)
initializes the simulator with a specified replication. |
void |
run()
The run method defines the actual time step mechanism of the simulator. |
void |
scheduleEvent(double relativeDelay,
Object source,
Object target,
String method,
Object[] args)
schedules a methodCall at a relative duration. |
void |
scheduleEvent(double relativeDelay,
short priority,
Object source,
Object target,
String method,
Object[] args)
schedules a methodCall at a relative duration. |
void |
scheduleEvent(double relativeDelay,
TimeUnitInterface timeUnit,
Object source,
Object target,
String method,
Object[] args)
schedules a methodCall at a relative duration. |
void |
scheduleEvent(double relativeDelay,
TimeUnitInterface timeUnit,
short priority,
Object source,
Object target,
String method,
Object[] args)
schedules a methodCall at a relative duration. |
void |
scheduleEvent(SimEventInterface event)
Method scheduleEvent schedules an event on the eventlist. |
void |
setEventList(EventListInterface eventList)
Method setEventList sets the eventlist. |
void |
step()
steps the simulator. |
void |
stop()
stops the simulator. |
Methods inherited from class nl.tudelft.simulation.dsol.simulators.Simulator |
---|
getReplication, getSimulatorTime, isRunning, start |
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.dsol.simulators.SimulatorInterface |
---|
getReplication, getSimulatorTime, isRunning, start |
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface |
---|
addListener, addListener, addListener, addListener, getEventTypes, removeListener |
Field Detail |
---|
protected EventListInterface eventList
Constructor Detail |
---|
public DEVSSimulator()
Method Detail |
---|
public boolean cancelEvent(SimEventInterface event)
DEVSSimulatorInterface
cancelEvent
in interface DEVSSimulatorInterface
event
- a simulation event to be canceled.
#cancelEvent(SimEventInterface)
public EventListInterface getEventList()
DEVSSimulatorInterface
getEventList
in interface DEVSSimulatorInterface
#getEventList()
public void initialize(Replication replication) throws RemoteException, SimRuntimeException
SimulatorInterface
initialize
in interface SimulatorInterface
initialize
in class Simulator
replication
- the replication
RemoteException
- on network failure
SimRuntimeException
- on simulator failure (simulator is running)#initialize(nl.tudelft.simulation.dsol.experiment.Replication)
public void scheduleEvent(SimEventInterface event) throws SimRuntimeException
DEVSSimulatorInterface
scheduleEvent
in interface DEVSSimulatorInterface
event
- a simulation event
SimRuntimeException
- whenever event is scheduled in past.#scheduleEvent(SimEventInterface)
public void scheduleEvent(double relativeDelay, Object source, Object target, String method, Object[] args) throws SimRuntimeException
DEVSSimulatorInterface
scheduleEvent
in interface DEVSSimulatorInterface
relativeDelay
- the relativeDelay in timeUnits of the simulator.source
- the source of the eventtarget
- the targetmethod
- the methodargs
- the arguments.
SimRuntimeException
- whenever the event is scheduled in the past.DEVSSimulatorInterface.scheduleEvent(double,
java.lang.Object, java.lang.Object, java.lang.String,
java.lang.Object[])
public void scheduleEvent(double relativeDelay, short priority, Object source, Object target, String method, Object[] args) throws SimRuntimeException
DEVSSimulatorInterface
scheduleEvent
in interface DEVSSimulatorInterface
relativeDelay
- the relativeDelay in timeUnits of the simulator.priority
- the priority compared to other events scheduled at the
same time.source
- the source of the eventtarget
- the targetmethod
- the methodargs
- the arguments.
SimRuntimeException
- whenever the event is scheduled in the past.DEVSSimulatorInterface.scheduleEvent(double,
short, java.lang.Object, java.lang.Object, java.lang.String,
java.lang.Object[])
public void scheduleEvent(double relativeDelay, TimeUnitInterface timeUnit, Object source, Object target, String method, Object[] args) throws RemoteException, SimRuntimeException
DEVSSimulatorInterface
scheduleEvent
in interface DEVSSimulatorInterface
relativeDelay
- the relativeDelay in timeUnits of the simulator.timeUnit
- the timeUnits of the delaysource
- the source of the eventtarget
- the targetmethod
- the methodargs
- the arguments.
RemoteException
- on network failure.
SimRuntimeException
- whenever the event is scheduled in the past.DEVSSimulatorInterface.scheduleEvent(double,
nl.tudelft.simulation.dsol.experiment.TimeUnitInterface,
java.lang.Object, java.lang.Object, java.lang.String,
java.lang.Object[])
public void scheduleEvent(double relativeDelay, TimeUnitInterface timeUnit, short priority, Object source, Object target, String method, Object[] args) throws RemoteException, SimRuntimeException
DEVSSimulatorInterface
scheduleEvent
in interface DEVSSimulatorInterface
relativeDelay
- the relativeDelay in timeUnits of the simulator.timeUnit
- the timeUnits of the delaypriority
- the priority compared to other events scheduled at the
same time.source
- the source of the eventtarget
- the targetmethod
- the methodargs
- the arguments.
RemoteException
- on network failure.
SimRuntimeException
- whenever the event is scheduled in the past.DEVSSimulatorInterface.scheduleEvent(double,
nl.tudelft.simulation.dsol.experiment.TimeUnitInterface, short,
java.lang.Object, java.lang.Object, java.lang.String,
java.lang.Object[])
public void setEventList(EventListInterface eventList)
DEVSSimulatorInterface
setEventList
in interface DEVSSimulatorInterface
eventList
- the eventList for the simulator.#setEventList(EventListInterface)
public void step() throws SimRuntimeException
SimulatorInterface
step
in interface SimulatorInterface
step
in class Simulator
SimRuntimeException
- whenever stepping fails. Possible occasions
include stepping a stopped simulatorSimulatorInterface.step()
public void run()
Simulator
run
in interface Runnable
run
in class Simulator
Simulator.run()
public void stop()
SimulatorInterface
stop
in interface SimulatorInterface
stop
in class Simulator
SimulatorInterface.stop()
protected void endReplication()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |