ix.isim
Class ISimTimerServer
java.lang.Object
ix.isim.ISimTimer
ix.isim.ISimTimerServer
public class ISimTimerServer
- extends ISimTimer
Fields inherited from class ix.isim.ISimTimer |
ACCELERATE, owner, PAUSE, REGISTER, RESUME, simTimeDisplay, simulationActive, START, STOP, SYNCHRONIZE_LABEL, tUpdater |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ISimTimerServer
protected ISimTimerServer(IXAgent agent)
start
public void start(long simTime,
double factor)
throws ISimTimerException
- Description copied from class:
ISimTimer
- This function starts the simulation clock. The simulation time will be
set to the given time and simulated time will progress with the given
acceleration factor. It also shows the frame displaying current sim-time
if it isn't already showing.
- Overrides:
start
in class ISimTimer
- Parameters:
simTime
- initial value of the simulated timefactor
- acceleration factor for simulated time
- Throws:
ISimTimerException
- if this function has been called before
pause
public long pause()
- Description copied from class:
ISimTimer
- This function pauses this simulation timer, be it a Server or Client. As
a result simulationActive will be false and the display will show it is
paused. However, the time update thread will continue to run.
- Overrides:
pause
in class ISimTimer
- Returns:
- long the simulation time when the simulation was paused
resume
public long resume()
- Description copied from class:
ISimTimer
- This function re-starts the simulation timer after it had been paused. As
a result simulationActive will be true and the display will show that it
is running.
- Overrides:
resume
in class ISimTimer
- Returns:
- long the simulation time when the simulation was resumed
changeAccelerationFactor
public long changeAccelerationFactor(double acceleration)
- Description copied from class:
ISimTimer
- This function changes the time acceleration factor to the given value.
- Overrides:
changeAccelerationFactor
in class ISimTimer
- Parameters:
acceleration
- double the new acceleration factor
- Returns:
- long the simulation time when the acceleration factor was changed
terminateTimer
public void terminateTimer()
- Description copied from class:
ISimTimer
- This function should be called terminate this Timer. It will gracefully
terminate the update thread for the display.
- Overrides:
terminateTimer
in class ISimTimer
handleSynchronizeActivity
public void handleSynchronizeActivity(Activity synchActivity)
- Description copied from class:
ISimTimer
- This function needs to be implemented by the inheriting class. This is
because the two types of ISimTimer, ISimTimerClient and ISimTimerServer,
behave differently with respect to synchronization. Having it abstract
ensures that no ISimTimer can ever be constructed.
- Specified by:
handleSynchronizeActivity
in class ISimTimer
- Parameters:
synchActivity
- a synchronization Activity (see final Strings in
this class for possible activities)
registerAgent
public void registerAgent(java.lang.String agentName)
sendStartActivity
public void sendStartActivity(long simTime,
double factor)
sendPauseActivity
public void sendPauseActivity(long simTime)
sendResumeActivity
public void sendResumeActivity(long simTime)
sendAccelerateActivity
public void sendAccelerateActivity(double factor)
sendStopActivity
public void sendStopActivity()