sim.display
Class RateAdjuster
java.lang.Object
sim.display.RateAdjuster
- All Implemented Interfaces:
- java.io.Serializable, Steppable
public class RateAdjuster
- extends java.lang.Object
- implements Steppable
A simple class which maintains a frame rate fixed to no more than a given number of ticks per second.
Typically this is used in games or visual demonstrations, where it is best to add it not to the Schedule
but to the GUIState's minischedule. For example, you could do this when start() and load(...) are called:
myGUIState.scheduleRepeatingImmediatelyAfter(new RateAdjuster(60)); // I want 60 frames per second maximum
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RateAdjuster
public RateAdjuster(double targetRate)
step
public void step(SimState state)
- Specified by:
step
in interface Steppable