Package org.powertac.server
Class CompetitionSetupService
- java.lang.Object
-
- org.powertac.server.CompetitionSetupService
-
- All Implemented Interfaces:
CompetitionSetup
@Service public class CompetitionSetupService extends Object implements CompetitionSetup
Manages command-line and file processing for pre-game simulation setup. A simulation can be started in one of two ways:- By running the process with command-line arguments as specified in
PowerTacServer, or - by calling the
preGame()method to set up the environment and allow configuration of the next game, through a web (or REST) interface.
- Author:
- John Collins
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCompetitionSetupService.CompetitionLoaderclassCompetitionSetupService.SeedLoader
-
Constructor Summary
Constructors Constructor Description CompetitionSetupService()Standard constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbootSession(String bootFilename, String configFilename, String gameId)StringbootSession(String bootFilename, String config, String game, String configDump)Starts a boot session with the given arguments.voidpreGame()Pre-game server setup - creates the basic configuration elements to make them accessible to the web-based game-setup functions.voidprocessCmdLine(String[] args)Processes command-line arguments, which means looking for the specified script file and processing thatStringsimSession(String bootData, String config, String jmsUrl, String gameId, List<String> brokerUsernames, String seedData, String weatherData, String inputQueueName)StringsimSession(String bootData, String config, String jmsUrl, String game, List<String> brokerUsernames, String seedData, String weatherData, String inputQueueName, String configOutput)
-
-
-
Method Detail
-
processCmdLine
public void processCmdLine(String[] args)
Processes command-line arguments, which means looking for the specified script file and processing that
-
bootSession
public String bootSession(String bootFilename, String config, String game, String configDump)
Starts a boot session with the given arguments. If the bootFilename is null, then runs just far enough to dump the configuration and quits.- Specified by:
bootSessionin interfaceCompetitionSetup
-
bootSession
public String bootSession(String bootFilename, String configFilename, String gameId)
- Specified by:
bootSessionin interfaceCompetitionSetup
-
simSession
public String simSession(String bootData, String config, String jmsUrl, String game, List<String> brokerUsernames, String seedData, String weatherData, String inputQueueName, String configOutput)
- Specified by:
simSessionin interfaceCompetitionSetup
-
simSession
public String simSession(String bootData, String config, String jmsUrl, String gameId, List<String> brokerUsernames, String seedData, String weatherData, String inputQueueName)
- Specified by:
simSessionin interfaceCompetitionSetup
-
preGame
public void preGame()
Pre-game server setup - creates the basic configuration elements to make them accessible to the web-based game-setup functions. This method must be called when the server is started, and again at the completion of each simulation. The actual simulation is started with a call to competitionControlService.runOnce().- Specified by:
preGamein interfaceCompetitionSetup
-
-