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 Details

    • EVENTLIST_CHANGED_EVENT

      static final EventType EVENTLIST_CHANGED_EVENT
      The EVENTLIST_CHANGED_EVENT is fired when the eventList is changed.
  • Method Details

    • cancelEvent

      boolean cancelEvent(SimEventInterface<T> event)
      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 target
      method - String; the method
      args - 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 target
      method - String; the method
      args - 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 target
      method - String; the method
      args - 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 target
      method - String; the method
      args - 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 target
      method - String; the method
      args - 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 target
      method - String; the method
      args - 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

      SimEventInterface<T> scheduleEventNow(Executable executable) throws SimRuntimeException
      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

      void setEventList(EventListInterface<T> eventList) throws SimRuntimeException
      Method setEventList sets the eventlist.
      Parameters:
      eventList - EventListInterface<T>; the eventList for the simulator.
      Throws:
      SimRuntimeException - whenever simulator.isRunning()==true
    • isPauseOnError

      @Deprecated boolean isPauseOnError()
      Deprecated.
      DEPRECATED: Replaced by getErrorHandler() and getErrorLogLevel().
      Returns:
      pauseOnError whether we pause on an error or not.
    • setPauseOnError

      @Deprecated void setPauseOnError(boolean pauseOnError)
      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 event
      target - Object; the target
      method - String; the method
      args - 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 event
      target - Object; the target
      method - String; the method
      args - 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 event
      target - Object; the target
      method - String; the method
      args - 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 event
      target - Object; the target
      method - String; the method
      args - 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 event
      target - Object; the target
      method - String; the method
      args - 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 event
      target - Object; the target
      method - String; the method
      args - Object[]; the arguments.
      Returns:
      the simulation event so it can be cancelled later
      Throws:
      SimRuntimeException - whenever the event is scheduled in the past.