Class LambdaSimEvent<T extends Number & Comparable<T>>

java.lang.Object
nl.tudelft.simulation.dsol.formalisms.eventscheduling.AbstractSimEvent<T>
nl.tudelft.simulation.dsol.formalisms.eventscheduling.LambdaSimEvent<T>
Type Parameters:
T - the type of simulation time, e.g. Double, Long or Duration
All Implemented Interfaces:
Serializable, Comparable<SimEventInterface<T>>, SimEventInterface<T>

public class LambdaSimEvent<T extends Number & Comparable<T>> extends AbstractSimEvent<T>
The SimEvent forms the essential scheduling mechanism for D-SOL. Objects do not invoke methods directly on eachother; they bundle the object on which the method is planned to be invoked together with the arguments and the name of the method in a simEvent. The SimEvent is then stored in the eventList and executed.

Copyright (c) 2016-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
See Also:
  • Field Details

    • executable

      protected Executable executable
      executable is the lambda expression tghat takes care of the state change.
  • Constructor Details

    • LambdaSimEvent

      public LambdaSimEvent(T executionTime, Executable executable)
      The constructor of the event stores the time the event must be executed and the object and method to invoke.
      Parameters:
      executionTime - T; the absolute time the event has to be executed.
      executable - Executable; the lambda method to invoke
    • LambdaSimEvent

      public LambdaSimEvent(T executionTime, short priority, Executable executable)
      The constructor of the event stores the time the event must be executed and the object and method to invoke.
      Parameters:
      executionTime - T; the time the event has to be executed.
      priority - short; the priority of the event
      executable - Executable; the lambda method to invoke
  • Method Details