|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.powertac.server.CompetitionControlService
@Service public class CompetitionControlService
This is the competition controller. It has two major roles in the server:
init() method must be
called. There are two versions of this method; the init()
version runs a "bootstrap" simulation that runs the customer models and
the wholesale market for a limited period of time to collect an initial
dataset from which brokers can bootstrap their internal models. During
a bootstrap simulation, external brokers cannot log in; only the default
broker is active. The init(filename) version loads bootstrap
data from the named file, validates it, and then opens up the
broker login process, most of which is delegated to the BrokerProxy.step() method is called every
timeslotLength seconds. This runs through
timeslotPhaseCount phases, calling the activate()
methods on registered components. Phases start at 1; by default there
are four phases.timeslotCount, the
simulation is ended.
| Constructor Summary | |
|---|---|
CompetitionControlService()
|
|
| Method Summary | |
|---|---|
void |
init()
Initializes the service in preparation for a new simulation |
boolean |
isBootstrapMode()
True just in case the sim is running in bootstrap mode |
boolean |
loginBroker(String username)
Logs in a broker, just in case the broker is on the authorizedBrokerList. |
void |
pause()
Signals that the clock is paused due to server overrun. |
void |
receiveMessage(org.powertac.common.msg.BrokerAuthentication msg)
Authenticate Broker. |
void |
receiveMessage(Object msg)
|
void |
receiveMessage(org.powertac.common.msg.PauseRelease msg)
Releases a broker-initiated pause. |
void |
receiveMessage(org.powertac.common.msg.PauseRequest msg)
Allows a broker to request a pause. |
void |
registerTimeslotPhase(org.powertac.common.interfaces.TimeslotPhaseProcessor thing,
int phase)
Allows instances of TimeslotPhaseProcessor to register themselves to be activated during one of the processing phases in each timeslot. |
void |
resume(long newStart)
Signals that the clock is resumed. |
void |
runOnce(boolean bootstrapMode)
Runs a simulation that is already set up. |
void |
setAlwaysAuthorizedBrokers(List<String> brokerList)
Sets the list of broker usernames that are always authorized, even in bootstrap mode. |
void |
setAuthorizedBrokerList(List<String> list)
Sets the list of brokers allowed and expected to log in before starting a simulation. |
void |
setBootstrapTimeslotMillis(long length)
Allows Spring to set the boostrap timeslot length |
void |
stop()
Signals the simulation thread to stop after processing is completed in the current timeslot. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompetitionControlService()
| Method Detail |
|---|
public void init()
public void setAlwaysAuthorizedBrokers(List<String> brokerList)
public void setAuthorizedBrokerList(List<String> list)
setAuthorizedBrokerList in interface org.powertac.common.interfaces.CompetitionControlpublic void runOnce(boolean bootstrapMode)
runOnce in interface org.powertac.common.interfaces.CompetitionControlpublic boolean loginBroker(String username)
loginBroker in interface org.powertac.common.interfaces.CompetitionControlpublic void stop()
public void registerTimeslotPhase(org.powertac.common.interfaces.TimeslotPhaseProcessor thing,
int phase)
registerTimeslotPhase in interface org.powertac.common.interfaces.CompetitionControlpublic boolean isBootstrapMode()
isBootstrapMode in interface org.powertac.common.interfaces.CompetitionControlpublic void pause()
public void resume(long newStart)
public void receiveMessage(org.powertac.common.msg.PauseRequest msg)
receiveMessage in interface org.powertac.common.interfaces.CompetitionControlpublic void receiveMessage(org.powertac.common.msg.PauseRelease msg)
receiveMessage in interface org.powertac.common.interfaces.CompetitionControlpublic void receiveMessage(org.powertac.common.msg.BrokerAuthentication msg)
public void setBootstrapTimeslotMillis(long length)
public void receiveMessage(Object msg)
receiveMessage in interface org.powertac.common.interfaces.BrokerMessageListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||