Package sim.display

Class RateAdjuster

java.lang.Object
sim.display.RateAdjuster
All Implemented Interfaces:
Serializable, Steppable

public class RateAdjuster extends 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:
  • Constructor Details

    • RateAdjuster

      public RateAdjuster(double targetRate)
  • Method Details