Package org.powertac.common.interfaces
Interface CompetitionControl
-
public interface CompetitionControl
This is the core of the Power TAC simulation framework, responsible for starting, running, and completing a competition. Plugins that are designed to run in the main simulation loop can be activated at the proper phase during each timeslot by registering themselves by phase number.- Author:
- jcollins
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isBootstrapMode()
True just in case the sim is running in bootstrap mode - generating bootstrap data.boolean
isRunning()
True if a simulation (boot or sim) session is currently running.boolean
loginBroker(String username)
Attempts to log in a broker by username.void
registerTimeslotPhase(TimeslotPhaseProcessor thing, int phase)
Registers the caller to be activated during each timeslot in the proper phase sequence.void
runOnce(boolean bootstrapMode)
Waits for broker login, then starts and runs a simulation.void
runOnce(boolean bootstrapMode, boolean dumpConfigOnly)
void
setAuthorizedBrokerList(List<String> brokerList)
Sets the list of brokers authorized to log in to the next game.void
shutDown()
Stops a running simulation, and sends out the SimEnd message to brokers.
-
-
-
Method Detail
-
isBootstrapMode
boolean isBootstrapMode()
True just in case the sim is running in bootstrap mode - generating bootstrap data.
-
registerTimeslotPhase
void registerTimeslotPhase(TimeslotPhaseProcessor thing, int phase)
Registers the caller to be activated during each timeslot in the proper phase sequence.
-
loginBroker
boolean loginBroker(String username)
Attempts to log in a broker by username. Returns true just in case the login is successful. The intent is that login will be successful if the username is on the authorizedBrokerList, or if it is one of the pre-configured brokers (usually only the default broker).
-
setAuthorizedBrokerList
void setAuthorizedBrokerList(List<String> brokerList)
Sets the list of brokers authorized to log in to the next game. Must be called after completion of a simulation and before calling runOnce(). This is normally done immediately after calling preGame().
-
runOnce
void runOnce(boolean bootstrapMode)
Waits for broker login, then starts and runs a simulation. The second form allows for configuration dumps without actually running the simulation.
-
runOnce
void runOnce(boolean bootstrapMode, boolean dumpConfigOnly)
-
isRunning
boolean isRunning()
True if a simulation (boot or sim) session is currently running.
-
shutDown
void shutDown()
Stops a running simulation, and sends out the SimEnd message to brokers.
-
-