|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IClock
The IClock interface is the interface to the simulation clock maintaining the base date and time of the simulation used relative to the event times. The event times start at the start of the simulation at 0, this is the simulated time. The simulated time is increased by the virtual machine's scheduler. The simulated time is 0 based and is not corrected for the time unit. To get the actual time of the event you need to get the base time and add the event time times the time unit. The time unit specifies how many seconds each simulated unit represents. If for an activity in a model is specified that the duration is 5 simulation units and the time unit is 1 second (default), then the actual duration of the activity is 5 seconds. If the time unit is 20 seconds then the actual duration of the activity would be 100 seconds.
Method Summary | |
---|---|
void |
addClockListener(IClockListener listener)
Adds the specified clock listener as a listener for value changes in the clock. |
long |
getActualTime()
Returns the actual simulated date and time. |
java.util.Calendar |
getBase()
Returns the base date and time of the clock. |
long |
getSimulatedTime()
Returns the current simulated time. |
long |
getTimeUnit()
Returns the time unit in seconds set for the virtual machine. |
void |
removeClockListener(IClockListener listener)
Removes the specified clock listener as a listener for value changes in the clock. |
Method Detail |
---|
java.util.Calendar getBase()
long getTimeUnit()
long getSimulatedTime()
getTimeUnit()
long getActualTime()
getSimulatedTime()
,
getTimeUnit()
void addClockListener(IClockListener listener)
listener
- the IClockListener to be registered.void removeClockListener(IClockListener listener)
listener
- the IClockListener to be unregistered.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |