manager
Class DistributedSchedule

java.lang.Object
  extended by uchicago.src.sim.engine.BasicAction
      extended by uchicago.src.sim.engine.ScheduleBase
          extended by uchicago.src.sim.engine.Schedule
              extended by manager.DistributedSchedule

public class DistributedSchedule
extends uchicago.src.sim.engine.Schedule

This class is a modified version of the standard RePast Schedule object. The distributed schedule inserts synchronisation points in to the standard execution algorithm and ensures that the model is in a state consistent with the current logical time before BasicAction events scheduled for this tick.

Author:
Rob Minson

Nested Class Summary
 
Nested classes/interfaces inherited from class uchicago.src.sim.engine.ScheduleBase
uchicago.src.sim.engine.ScheduleBase.Order
 
Field Summary
static StopWatch hlaTimer
           
static StopWatch repastTimer
           
 
Fields inherited from class uchicago.src.sim.engine.ScheduleBase
actionQueue, CONCURRENT, groupToExecute, indexCount, LAST, lastGroup, lastQueue, preExecuted, randGroup, repeatInterval, ticks, topGroup
 
Fields inherited from class uchicago.src.sim.engine.BasicAction
INTERVAL_UPDATER, ONE_TIME_UPDATER, updater
 
Method Summary
 void addDisplayAction(uchicago.src.sim.engine.BasicAction action)
          This allows for the scheduling of a single BasicAction that should be used for refreshing the display surface during a gui-based run.
 void execute()
           
 long getCurrentTime()
          Returns the timestamp of the most recently executed event.
 void preExecute()
          Performs the standard ScheduleBase job of preExecute (determining the group of events (including LAST, FIRST and RANDOM events) should be executed.
 
Methods inherited from class uchicago.src.sim.engine.Schedule
executeEndActions, executePauseActions, getEndActions, getPauseActions, removeEndAction, removePauseAction, scheduleActionAtEnd, scheduleActionAtEnd, scheduleActionAtEnd, scheduleActionAtEnd, scheduleActionAtEndRnd, scheduleActionAtEndRnd, scheduleActionAtPause, scheduleActionAtPause, scheduleActionAtPause, scheduleActionAtPause, scheduleActionAtPauseRnd, scheduleActionAtPauseRnd
 
Methods inherited from class uchicago.src.sim.engine.ScheduleBase
getCurrentTimeDouble, removeAction, removeActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAt, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtInterval, scheduleActionAtIntervalRnd, scheduleActionAtIntervalRnd, scheduleActionAtIntervalRnd, scheduleActionAtIntervalRnd, scheduleActionAtIntervalRnd, scheduleActionAtIntervalRnd, scheduleActionAtIntervalRnd, scheduleActionAtIntervalRnd, scheduleActionAtRnd, scheduleActionAtRnd, scheduleActionAtRnd, scheduleActionAtRnd, scheduleActionAtRnd, scheduleActionAtRnd, scheduleActionAtRnd, scheduleActionAtRnd, scheduleActionBeginning, scheduleActionBeginning, scheduleActionBeginning, scheduleActionBeginning, scheduleActionBeginning, scheduleActionBeginning, scheduleActionBeginning, scheduleActionBeginning, scheduleActionBeginningRnd, scheduleActionBeginningRnd, scheduleActionBeginningRnd, scheduleActionBeginningRnd
 
Methods inherited from class uchicago.src.sim.engine.BasicAction
addToGroup, getName, getNextTime, reSchedule, setName, setNextTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

repastTimer

public static StopWatch repastTimer

hlaTimer

public static StopWatch hlaTimer
Method Detail

preExecute

public void preExecute()
Performs the standard ScheduleBase job of preExecute (determining the group of events (including LAST, FIRST and RANDOM events) should be executed. The distributed version also ensures that the federate has permission from the synchronisation algorithm to advance to the time of the next local event. In the process of this advance the federate will receive a set of events from other federates which will be buffered by the time the preExecute call returns. The first act that the execute() method performs is to apply these external events to the local model (see the flushCall references below)

Overrides:
preExecute in class uchicago.src.sim.engine.ScheduleBase

execute

public void execute()
Overrides:
execute in class uchicago.src.sim.engine.Schedule

addDisplayAction

public void addDisplayAction(uchicago.src.sim.engine.BasicAction action)
This allows for the scheduling of a single BasicAction that should be used for refreshing the display surface during a gui-based run. It is extremely important that this action should not attempt to modify the state of any shared objects.

Generally local events are integrated in to the global scheduling mechanism, however, were this to be true of screen-update events it would dramatically reduce the performance of the system without any gain in fidelity or correctness.

Parameters:
action - an event (or nested sequence of events) which updates the display of the simulation at this node.

getCurrentTime

public long getCurrentTime()
Returns the timestamp of the most recently executed event.

Overrides:
getCurrentTime in class uchicago.src.sim.engine.ScheduleBase