All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class utils.timers.FixedKicker

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----utils.timers.FixedKicker

public class FixedKicker
extends Thread
a Thread which throws equally sized timesteps at a Dynamic object.
It tries to keep the realtime intervals between kicks constant, and near a user defined level.

See Also:
Dynamic

Variable Index

 o dt
 o MIN_SLEEP
the minimum amount of time that the thread will actually spend sleeping per kick

Constructor Index

 o FixedKicker(Dynamic, long)

Method Index

 o pleaseStop()
the nice way to stop the thread.
 o run()
 o setSleepTime(long)
 o start()

Variables

 o MIN_SLEEP
 public static final long MIN_SLEEP
the minimum amount of time that the thread will actually spend sleeping per kick

 o dt
 public static double dt

Constructors

 o FixedKicker
 public FixedKicker(Dynamic d,
                    long s)
Parameters:
d - the @see Dynamic object to be kicked
f - how much to scale the actul time(in ms) to get simulation time
s - desired interval between hitting the top of the run loop

Methods

 o start
 public void start()
Overrides:
start in class Thread
 o run
 public void run()
Overrides:
run in class Thread
 o pleaseStop
 public void pleaseStop()
the nice way to stop the thread. i.e. the thread will drop out of the run method. this prevents "IllegalThreadStateException"s if the Dynamic object is used again

 o setSleepTime
 public void setSleepTime(long new_sleep)

All Packages  Class Hierarchy  This Package  Previous  Next  Index