Class SimulationTimer

java.lang.Object
  extended by SimulationTimer

public class SimulationTimer
extends java.lang.Object

The SimulationTimer class encapsulates a simple integer timer. You will interact with the SimulationTimer class in two ways:

  1. You will query the current time with the getTime() method.
  2. You will advance the timer after your simulation has done all of the work for a given timestep by using the tick() method.


Constructor Summary
SimulationTimer()
          Creates a SimulationTimer with a simulation time of 0.
 
Method Summary
 int getTime()
          Returns the current simulation time.
 void tick()
          Increments the simulation timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimulationTimer

public SimulationTimer()
Creates a SimulationTimer with a simulation time of 0.

Method Detail

getTime

public int getTime()
Returns the current simulation time.

Returns:
the current simulation time.

tick

public void tick()
Increments the simulation timer.