Class DateBasedTimer

java.lang.Object
madkit.simulation.scheduler.SimuTimer<LocalDateTime>
madkit.simulation.scheduler.DateBasedTimer

public class DateBasedTimer extends SimuTimer<LocalDateTime>
This class encapsulates the time of the simulation. Its purpose is that it can be passed across objects without problem. That is, BigDecimal is immutable and therefore creates a new instance for each modification.
Since:
MaDKit 5.3
See Also:
  • Constructor Details

  • Method Details

    • incrementCurrentDate

      public void incrementCurrentDate(long amountToAdd, ChronoUnit unit)
      Increments the current date by the specified amount and unit.
      Parameters:
      amountToAdd - the amount to add
      unit - the unit of the amount to add
    • incrementCurrentDate

      public void incrementCurrentDate(long amountToAdd)
      Increments the current date by the specified amount using the default unit.
      Parameters:
      amountToAdd - the amount to add
    • setDefaultTemporalUnit

      public void setDefaultTemporalUnit(ChronoUnit unit)
      Sets the default temporal unit for date increments.
      Parameters:
      unit - the default temporal unit
    • getDefaultTemporalUnit

      public ChronoUnit getDefaultTemporalUnit()
      Gets the default temporal unit for date increments.
      Returns:
      the default temporal unit
    • addOneTimeUnit

      public void addOneTimeUnit()
      Adds one time unit to the current date using the default unit.