Broker Tournament Login

jecollins edited this page Nov 29, 2012 · 10 revisions

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:

  1. 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.

  2. 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.

  3. 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

  1. Create a login in the Tournament Scheduler

  2. Navigate to your account page.

  1. Create a broker name authorization token pair.

  1. 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 org.powertac.samplebroker.core.BrokerTournamentService.
  • There is a new pom.xml file. 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.properties file. 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.
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.