Interface DevsSimulatorInterface<T extends Number & Comparable<T>>
- Type Parameters:
T
- the time type
- All Superinterfaces:
EventProducer
,Remote
,Serializable
,SimulatorInterface<T>
- All Known Implementing Classes:
DevDessAnimator
,DevDessSimulator
,DevsAnimator
,DevsRealTimeAnimator
,DevsRealTimeAnimator.TimeDouble
,DevsRealTimeAnimator.TimeDoubleUnit
,DevsRealTimeAnimator.TimeFloat
,DevsRealTimeAnimator.TimeFloatUnit
,DevsRealTimeAnimator.TimeLong
,DevsSimulator
public interface DevsSimulatorInterface<T extends Number & Comparable<T>>
extends SimulatorInterface<T>
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.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Since:
- 1.5
- Author:
- Peter Jacobs , Alexander Verbraeck
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EventType
The EVENTLIST_CHANGED_EVENT is fired when the eventList is changed.Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
Fields inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
START_EVENT, STARTING_EVENT, STOP_EVENT, STOPPING_EVENT, TIME_CHANGED_EVENT
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cancelEvent
(SimEventInterface<T> event) cancels an event from the event list.returns the eventlist of the simulator.boolean
Deprecated.scheduleEvent
(SimEventInterface<T> event) Method scheduleEvent schedules an event on the eventlist.default SimEventInterface<T>
scheduleEventAbs
(T absoluteTime, short priority, Object source, Object target, String method, Object[] args) Deprecated.scheduleEventAbs
(T absoluteTime, short priority, Object target, String method, Object[] args) schedules a methodCall at an absolute time.scheduleEventAbs
(T absoluteTime, short priority, Executable executable) schedules a lambda expression at an absolute time.default SimEventInterface<T>
Deprecated.scheduleEventAbs
(T absoluteTime, Object target, String method, Object[] args) schedules a methodCall at an absolute time.scheduleEventAbs
(T absoluteTime, Executable executable) schedules a lambda expression at an absolute time.default SimEventInterface<T>
scheduleEventNow
(short priority, Object source, Object target, String method, Object[] args) Deprecated.scheduleEventNow
(short priority, Object target, String method, Object[] args) schedules a methodCall immediately.scheduleEventNow
(short priority, Executable executable) schedules a lambda expression immediately.default SimEventInterface<T>
scheduleEventNow
(Object source, Object target, String method, Object[] args) Deprecated.scheduleEventNow
(Object target, String method, Object[] args) schedules a methodCall immediately.scheduleEventNow
(Executable executable) schedules a lambda expression immediately.default SimEventInterface<T>
scheduleEventRel
(T relativeDelay, short priority, Object source, Object target, String method, Object[] args) Deprecated.scheduleEventRel
(T relativeDelay, short priority, Object target, String method, Object[] args) schedules a methodCall at a relative duration.scheduleEventRel
(T relativeDelay, short priority, Executable executable) schedules a lambda expression at a relative duration.default SimEventInterface<T>
Deprecated.scheduleEventRel
(T relativeDelay, Object target, String method, Object[] args) schedules a methodCall at a relative duration.scheduleEventRel
(T relativeDelay, Executable executable) schedules a lambda expression at a relative duration.void
setEventList
(EventListInterface<T> eventList) Method setEventList sets the eventlist.void
setPauseOnError
(boolean pauseOnError) Deprecated.Methods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
addScheduledMethodOnInitialize, addScheduledMethodOnInitialize, cleanUp, endReplication, getErrorLogLevel, getErrorStrategy, getLogger, getModel, getReplication, getReplicationState, getRunState, getSimulatorTime, initialize, isInitialized, isStartingOrRunning, isStoppingOrStopped, runUpTo, runUpToAndIncluding, setErrorLogLevel, setErrorStrategy, setErrorStrategy, start, step, stop
-
Field Details
-
EVENTLIST_CHANGED_EVENT
The EVENTLIST_CHANGED_EVENT is fired when the eventList is changed.
-
-
Method Details
-
cancelEvent
cancels an event from the event list.- Parameters:
event
- SimEventInterface<T>; a simulation event to be canceled.- Returns:
- boolean the succes of the operation.
-
getEventList
EventListInterface<T> getEventList()returns the eventlist of the simulator.- Returns:
- the eventlist.
-
scheduleEvent
Method scheduleEvent schedules an event on the eventlist.- Parameters:
event
- SimEventInterface<T>; a simulation event- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever event is scheduled in past.
-
scheduleEventRel
SimEventInterface<T> scheduleEventRel(T relativeDelay, short priority, Object target, String method, Object[] args) throws SimRuntimeException schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.- Parameters:
relativeDelay
- T; the relativeDelay in timeUnits of the simulator.priority
- short; the priority compared to other events scheduled at the same time.target
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventRel
SimEventInterface<T> scheduleEventRel(T relativeDelay, Object target, String method, Object[] args) throws SimRuntimeException schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.- Parameters:
relativeDelay
- T; the relativeDelay in timeUnits of the simulator.target
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventAbs
SimEventInterface<T> scheduleEventAbs(T absoluteTime, short priority, Object target, String method, Object[] args) throws SimRuntimeException schedules a methodCall at an absolute time.- Parameters:
absoluteTime
- T; the exact time to schedule the method on the simulator.priority
- short; the priority compared to other events scheduled at the same time.target
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventAbs
SimEventInterface<T> scheduleEventAbs(T absoluteTime, Object target, String method, Object[] args) throws SimRuntimeException schedules a methodCall at an absolute time.- Parameters:
absoluteTime
- T; the exact time to schedule the method on the simulator.target
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventNow
SimEventInterface<T> scheduleEventNow(short priority, Object target, String method, Object[] args) throws SimRuntimeException schedules a methodCall immediately.- Parameters:
priority
- short; the priority compared to other events scheduled at the same time.target
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventNow
SimEventInterface<T> scheduleEventNow(Object target, String method, Object[] args) throws SimRuntimeException schedules a methodCall immediately.- Parameters:
target
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventRel
SimEventInterface<T> scheduleEventRel(T relativeDelay, short priority, Executable executable) throws SimRuntimeException schedules a lambda expression at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.- Parameters:
relativeDelay
- T; the relativeDelay in timeUnits of the simulator.priority
- short; the priority compared to other events scheduled at the same time.executable
- Executable; the lambda expression to execute- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventRel
SimEventInterface<T> scheduleEventRel(T relativeDelay, Executable executable) throws SimRuntimeException schedules a lambda expression at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.- Parameters:
relativeDelay
- T; the relativeDelay in timeUnits of the simulator.executable
- Executable; the lambda expression to execute- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventAbs
SimEventInterface<T> scheduleEventAbs(T absoluteTime, short priority, Executable executable) throws SimRuntimeException schedules a lambda expression at an absolute time.- Parameters:
absoluteTime
- T; the exact time to schedule the method on the simulator.priority
- short; the priority compared to other events scheduled at the same time.executable
- Executable; the lambda expression to execute- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventAbs
SimEventInterface<T> scheduleEventAbs(T absoluteTime, Executable executable) throws SimRuntimeException schedules a lambda expression at an absolute time.- Parameters:
absoluteTime
- T; the exact time to schedule the method on the simulator.executable
- Executable; the lambda expression to execute- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventNow
SimEventInterface<T> scheduleEventNow(short priority, Executable executable) throws SimRuntimeException schedules a lambda expression immediately.- Parameters:
priority
- short; the priority compared to other events scheduled at the same time.executable
- Executable; the lambda expression to execute- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventNow
schedules a lambda expression immediately.- Parameters:
executable
- Executable; the lambda expression to execute- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
setEventList
Method setEventList sets the eventlist.- Parameters:
eventList
- EventListInterface<T>; the eventList for the simulator.- Throws:
SimRuntimeException
- whenever simulator.isRunning()==true
-
isPauseOnError
Deprecated.DEPRECATED: Replaced by getErrorHandler() and getErrorLogLevel().- Returns:
- pauseOnError whether we pause on an error or not.
-
setPauseOnError
Deprecated.DEPRECATED: Replaced by setErrorHandler() and setErrorLogLevel(). Set the boolean whether we pause on an error or not.- Parameters:
pauseOnError
- boolean; set true or false.
-
scheduleEventRel
@Deprecated default SimEventInterface<T> scheduleEventRel(T relativeDelay, short priority, Object source, Object target, String method, Object[] args) throws SimRuntimeException Deprecated.DEPRECATED: source field is no longer used.
schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.- Parameters:
relativeDelay
- T; the relativeDelay in timeUnits of the simulator.priority
- short; the priority compared to other events scheduled at the same time.source
- Object; the source of the eventtarget
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventRel
@Deprecated default SimEventInterface<T> scheduleEventRel(T relativeDelay, Object source, Object target, String method, Object[] args) throws SimRuntimeException Deprecated.DEPRECATED: source field is no longer used.
schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.- Parameters:
relativeDelay
- T; the relativeDelay in timeUnits of the simulator.source
- Object; the source of the eventtarget
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventAbs
@Deprecated default SimEventInterface<T> scheduleEventAbs(T absoluteTime, short priority, Object source, Object target, String method, Object[] args) throws SimRuntimeException Deprecated.DEPRECATED: source field is no longer used.
schedules a methodCall at an absolute time.- Parameters:
absoluteTime
- T; the exact time to schedule the method on the simulator.priority
- short; the priority compared to other events scheduled at the same time.source
- Object; the source of the eventtarget
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventAbs
@Deprecated default SimEventInterface<T> scheduleEventAbs(T absoluteTime, Object source, Object target, String method, Object[] args) throws SimRuntimeException Deprecated.DEPRECATED: source field is no longer used.
schedules a methodCall at an absolute time.- Parameters:
absoluteTime
- T; the exact time to schedule the method on the simulator.source
- Object; the source of the eventtarget
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventNow
@Deprecated default SimEventInterface<T> scheduleEventNow(short priority, Object source, Object target, String method, Object[] args) throws SimRuntimeException Deprecated.DEPRECATED: source field is no longer used.
schedules a methodCall immediately.- Parameters:
priority
- short; the priority compared to other events scheduled at the same time.source
- Object; the source of the eventtarget
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-
scheduleEventNow
@Deprecated default SimEventInterface<T> scheduleEventNow(Object source, Object target, String method, Object[] args) throws SimRuntimeException Deprecated.DEPRECATED: source field is no longer used.
schedules a methodCall immediately.- Parameters:
source
- Object; the source of the eventtarget
- Object; the targetmethod
- String; the methodargs
- Object[]; the arguments.- Returns:
- the simulation event so it can be cancelled later
- Throws:
SimRuntimeException
- whenever the event is scheduled in the past.
-