Class Model

java.lang.Object
com.amalgamasimulation.engine.Model
All Implemented Interfaces:
Timeable, Serializable

public abstract class Model extends Object implements Serializable, Timeable
Base class for all simulation models. It is recommended that any class of simulation model should inherit from this class. Although such inheritance is not mandatory.
Author:
Andrey Malykhanov
See Also:
  • Constructor Details

    • Model

      protected Model(Engine engine)
      Creates a new instance of Model simulated by the specified instance of Engine.
      Parameters:
      engine - instance of Engine used to simulate this model
  • Method Details

    • engine

      public Engine engine()
      Returns the reference to an Engine used to simulate this model.
      Returns:
      reference to an Engine used to simulate this model
    • time

      public double time()
      Returns the current simulation time, more specifically, time of Engine used to simulate this model.
      Returns:
      current simulation time
    • date

      public LocalDateTime date()
      Returns the current simulation date, more specifically, date of Engine used to simulate this model.
      Returns:
      current simulation date
    • beginDate

      public LocalDateTime beginDate()
      Description copied from interface: Timeable
      Returns the begin date, i.e. the simulation date that corresponds to zero simulation time
      Specified by:
      beginDate in interface Timeable
      Returns:
      simulation date that corresponding to zero simulation time
    • timeUnit

      public ChronoUnit timeUnit()
      Description copied from interface: Timeable
      Returns the simulation time unit, i.e. period unit that corresponds to one unit of simulation time
      Specified by:
      timeUnit in interface Timeable
      Returns:
      period unit that corresponds to one unit of simulation time