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

Variable Index

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

Constructor Index

 o TimeKicker(Dynamic, double, long)

Method Index

 o pleaseStop()
the nice way to stop the thread.
 o run()
 o setMaxDT(double)
 o setSleepTime(long)
 o setTimeFactor(double)
 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

Constructors

 o 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

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 setMaxDT
 public void setMaxDT(double new_max)
 o setTimeFactor
 public void setTimeFactor(double new_factor)
 o setSleepTime
 public void setSleepTime(long new_sleep)

All Packages  Class Hierarchy  This Package  Previous  Next  Index