Package org.powertac.common.interfaces
Class TimeslotPhaseProcessor
java.lang.Object
org.powertac.common.interfaces.TimeslotPhaseProcessor
- Direct Known Subclasses:
CustomerModelService
public abstract class TimeslotPhaseProcessor extends Object
Plugins must extend this class in order to be invoked during timeslot
processing by the CompetitionControl. Each subclass must implement the
activate() method to do its thing during a timeslot, and must call its
superclass init() method during per-game initialization.
Per-timeslot processing takes place in
phases. See https://github.com/powertac/powertac-server/wiki/Competition-controller-timeslot-process
for a summary of this process.
- Author:
- John Collins
-
Constructor Summary
Constructors Constructor Description TimeslotPhaseProcessor() -
Method Summary
Modifier and Type Method Description abstract voidactivate(org.joda.time.Instant time, int phaseNumber)This method gets called once during each timeslot.protected voidinit()This method must be called in the per-game initialization code in each implementing class.voidsetTimeslotPhase(int newValue)This is the Spring-accessible setter for the phase number
-
Constructor Details
-
TimeslotPhaseProcessor
public TimeslotPhaseProcessor()
-
-
Method Details
-
init
protected void init()This method must be called in the per-game initialization code in each implementing class. This is where the timeslot phase registration gets done. -
setTimeslotPhase
public void setTimeslotPhase(int newValue)This is the Spring-accessible setter for the phase number -
activate
public abstract void activate(org.joda.time.Instant time, int phaseNumber)This method gets called once during each timeslot. To get called, the module must first call the register(phaseNumber) method on CompetitionControl. The call will give the current simulation time and phase number in the arguments.
-