logist
Class Measures

java.lang.Object
  extended by logist.Measures

public class Measures
extends java.lang.Object

Defines unit conversions between external values from XML files (e.g. kilometers) and internal representations (e.g. distance units). The platform avoids the use of floating point number to increase precision and avoid non-determinism.

Author:
Robin Steiger

Field Summary
static long DISTANCE_UNITS_PER_KM
          The number of distance units in a kilometer.
static long NANOS_PER_SIM_HOUR
          The time (in nanos) that it takes to animate one hour of simulation (in GUI mode).
 
Constructor Summary
Measures()
           
 
Method Summary
static long kmToUnits(double kilometers)
          Convert kilometers to distance units.
static double unitsToKM(long units)
          Convert distance units to kilometers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISTANCE_UNITS_PER_KM

public static final long DISTANCE_UNITS_PER_KM
The number of distance units in a kilometer. A distance unit is the smallest distance that a vehicle can travel.

See Also:
Constant Field Values

NANOS_PER_SIM_HOUR

public static final long NANOS_PER_SIM_HOUR
The time (in nanos) that it takes to animate one hour of simulation (in GUI mode).

See Also:
Constant Field Values
Constructor Detail

Measures

public Measures()
Method Detail

kmToUnits

public static long kmToUnits(double kilometers)
Convert kilometers to distance units.

Parameters:
kilometers - the distance in km

unitsToKM

public static double unitsToKM(long units)
Convert distance units to kilometers.

Parameters:
units - the distance in units