All Packages Class Hierarchy This Package Previous Next Index
Class utils.timers.TimeKicker
java.lang.Object
|
+----java.lang.Thread
|
+----utils.timers.TimeKicker
- public class TimeKicker
- extends Thread
a Thread which throws variable sized timesteps at a Dynamic
object.
It tries to keep the realtime intervals between kicks constant,
and near a user defined level.
It the size of the timestep[simulation units] is some multiple
of the actual time elapsed since the last kick.
- See Also:
- Dynamic
-
MIN_SLEEP
- the minimum amount of time that the thread will actually spend sleeping
per kick
-
TimeKicker(Dynamic, double, long)
-
-
pleaseStop()
-
the nice way to stop the thread.
-
run()
-
-
setMaxDT(double)
-
-
setSleepTime(long)
-
-
setTimeFactor(double)
-
-
start()
-
MIN_SLEEP
public static final long MIN_SLEEP
- the minimum amount of time that the thread will actually spend sleeping
per kick
TimeKicker
public TimeKicker(Dynamic d,
double f,
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
start
public void start()
- Overrides:
- start in class Thread
run
public void run()
- Overrides:
- run in class Thread
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
setMaxDT
public void setMaxDT(double new_max)
setTimeFactor
public void setTimeFactor(double new_factor)
setSleepTime
public void setSleepTime(long new_sleep)
All Packages Class Hierarchy This Package Previous Next Index