Competition control timeslot process - Pyosch/powertac-server GitHub Wiki

up
At the beginning of each timeslot, the competition control will be activated by the clock, presumably because it has put its activation closure on the clock queue. During the timeslot, the competition-control activates other server components in three phases, as shown below:

Competition control timeslot process

In each of the three phases, the order of calls is not important; in fact, they can be run in parallel threads. These dependencies could clearly be inverted through an observer-type interaction.

Modules that wish to be notified must implement the TimeslotPhaseProcessor interface, and must register with the CompetitionControlService by calling registerTimeslotPhase(thing, phase) where phase is the phase number. Note that the first phase is 1, not 0, to make documentation easier. It is even possible for a module to register twice, for different phases. When the appropriate phase arrives, the module will be called using its activate(time, phase) method.

⚠️ **GitHub.com Fallback** ⚠️