Class DoubleTime

  • All Implemented Interfaces:
    it.unibo.alchemist.model.Time , java.io.Serializable , java.lang.Comparable

    
    public final class DoubleTime
     implements Time
                        

    This class is meant to provide a reasonably fast time implementation. Should be suitable for most usages, but it inherits the problem of the loss of precision of double numbers when comparing big numbers with low numbers. It could become a real problem with long simulations.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static Time.Companion Companion
      public final static Time ZERO
      public final static Time INFINITY
      public final static Time NEGATIVE_INFINITY
    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleTime() Default empty constructor, builds a DoubleTime with value 0.
      DoubleTime(double val) Builds a new DoubleTime starting from the specified value.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • DoubleTime

        DoubleTime()
        Default empty constructor, builds a DoubleTime with value 0.
      • DoubleTime

        DoubleTime(double val)
        Builds a new DoubleTime starting from the specified value.
        Parameters:
        val - the starting value of the time.