core
Class SimClock

java.lang.Object
  extended by core.SimClock

public class SimClock
extends java.lang.Object

Wall clock for checking the simulation time.


Method Summary
 void advance(double time)
          Advances the time by n seconds
static SimClock getInstance()
          Get the instance of the class that can also change the time.
static int getIntTime()
          Returns the current time rounded to the nearest integer
static double getTime()
          Returns the current time (seconds since start)
static void reset()
          Resets the static fields of the class
 void setTime(double time)
          Sets the time of the clock.
 java.lang.String toString()
          Returns the current simulation time in a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static SimClock getInstance()
Get the instance of the class that can also change the time.

Returns:
The instance of this clock

getTime

public static double getTime()
Returns the current time (seconds since start)

Returns:
Time as a double

getIntTime

public static int getIntTime()
Returns the current time rounded to the nearest integer

Returns:
Time as integer

advance

public void advance(double time)
Advances the time by n seconds

Parameters:
time - Nrof seconds to increase the time

setTime

public void setTime(double time)
Sets the time of the clock.

Parameters:
time - the time to set

toString

public java.lang.String toString()
Returns the current simulation time in a string

Overrides:
toString in class java.lang.Object
Returns:
the current simulation time in a string

reset

public static void reset()
Resets the static fields of the class