public class SimClock
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
advance(double time)
Advances the time by n seconds
|
static java.lang.String |
getFormattedTime(int decimals)
Returns a string presentation of the sim time shown with the given amount
of decimals
|
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
|
public static SimClock getInstance()
public static double getTime()
public static int getIntTime()
public static java.lang.String getFormattedTime(int decimals)
decimals - The number of decimals to showpublic void advance(double time)
time - Nrof seconds to increase the timepublic void setTime(double time)
time - the time to setpublic java.lang.String toString()
toString in class java.lang.Objectpublic static void reset()