alchemist-time / it.unibo.alchemist.model.implementations.times / DoubleTime

DoubleTime

class DoubleTime : 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.

Constructors

<init>

Default empty constructor, builds a DoubleTime with value 0.

DoubleTime()

Builds a new DoubleTime starting from the specified value.

DoubleTime(val: Double)

Properties

INFINITE_TIME

Infinite time.

static val INFINITE_TIME: DoubleTime!

ZERO_TIME

Time zero.

static val ZERO_TIME: DoubleTime!

Functions

compareTo

fun compareTo(other: Time!): Int

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

isInfinite

fun isInfinite(): Boolean

minus

fun minus(dt: Time!): Time!

plus

fun plus(dt: Time!): DoubleTime!

times

fun times(var: Double): Time!

toDouble

fun toDouble(): Double

toString

fun toString(): String