Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Broker Tournament Login
The latest version of the PowerTac Sample Broker contains the BrokerTournamentService which will handle all of the communication to login to a simulation via the Tournament Scheduler. See below for instructions to modify an existing broker to work in this environment.
Essentially this service will attempt to login to the tournament scheduler and one of three things can happen:
The Tournament Scheduler has not yet started your next game, this will cause the BrokerTournamentService to spin for a certain amount of time before it automatically tries to login again.
The Tournament Scheduler has started your next game, this will cause the BrokerTournamentService to return the jmsUrl that you should connect to join the game.
The Tournament Scheduler does not have you registered for any tournaments or games, this will cause the BrokerTournamentService to shutdown the broker. (Make sure that you are registered)
To Set Up Your Broker for a Competition
Create a login in the Tournament Scheduler
Navigate to your account page.
- Create a broker name authorization token pair.
- Modify local broker properties file.
Running your broker
If the properties options are set correctly, the broker will automatically attempt to login. Details on the use of the broker's command-line arguments are included in the README file that comes with the sample-broker package. For a tournament login, you need to specify either a duration or a repeat-count so the broker will play in repeated games without manual intervention. To get the broker to play 50 games before stopping, the command is
mvn exec:exec -Dexec.args="--repeat-count 50"
Modifying an existing broker to work with the Tournament Scheduler
As of 21 May 2012, the sample broker contains the necessary code to log in as described above. You can pull it from github, or you can grab the source bundle. The changes from an earlier sample broker are in four places:
- There is a new module
- There is a new
pom.xmlfile. If you have not modified
pom.xml, you can use the one in the source bundle, otherwise you can see what was changed.
- There are four additional properties settings in the
broker.propertiesfile. Three of these will need to be set up for the specific competition.
- There are a few changes to
org.powertac.samplebroker.core.PowerTacBroker. Assuming you have not changed this file in your broker, you can use the one in the source package; otherwise you can see what changed. There is also a second change.