|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jasi.sim.basic.control.AbstractSimListener jasi.sim.basic.control.AbstractSimController jasi.sim.user.Timer
public class Timer
A standard simulation timer, that advances time according real time with a given speed. For each time advance this timer calculates the duration which is uses to set the simulation thread to sleep.
Constructor Summary | |
---|---|
Timer()
Constructor. |
Method Summary | |
---|---|
Time |
advance(Time time,
Time next)
Request an advance of the simulation time. |
void |
finish(Time time)
A simulation thread has finished. |
double |
getSpeed()
Get the simulation speed factor, given in multiples of realtime. |
void |
setSpeed(double speed)
Set the simulation speed factor, given in multiples of real-time. |
Time |
start(Time time)
A simulation thread will be started. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class jasi.sim.basic.control.AbstractSimController |
---|
change, createdElement, gotException, request |
Methods inherited from class jasi.sim.basic.control.AbstractSimListener |
---|
advancedTime, changedElement, deletedElement, finishedReadingArchive, finishedSimulation, finishedWritingArchive, gotMessage, poppedEvent, pushedEvent, removedEvent, requestedElement, startedSimulation, startReadingArchive, startWritingArchive |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jasi.sim.basic.control.SimListener |
---|
advancedTime, finishedReadingArchive, finishedSimulation, finishedWritingArchive, gotMessage, startedSimulation, startReadingArchive, startWritingArchive |
Methods inherited from interface jasi.sim.basic.element.ElementsListener |
---|
changedElement, deletedElement, requestedElement |
Methods inherited from interface jasi.sim.basic.event.CalendarListener |
---|
poppedEvent, pushedEvent, removedEvent |
Constructor Detail |
---|
public Timer()
Method Detail |
---|
public Time start(Time time)
start
in interface SimController
start
in class AbstractSimController
time
- The requested start time.
AbstractSimKernel.startSimulation()
public Time advance(Time time, Time next)
advance
in interface SimController
advance
in class AbstractSimController
time
- The current time.next
- The requested time advance.
AbstractSimKernel.continueSimulation(jasi.sim.basic.value.Time, jasi.sim.basic.value.Time)
public void finish(Time time)
finish
in interface SimController
finish
in class AbstractSimController
time
- The current time.AbstractSimKernel.finishSimulation()
public double getSpeed()
getSpeed
in interface SimController
getSpeed
in class AbstractSimController
public void setSpeed(double speed)
setSpeed
in interface SimController
setSpeed
in class AbstractSimController
speed
- The simulation speed factor.public java.lang.String toString()
toString
in class AbstractSimController
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |