Class 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
    • Constructor Detail

      • CompetitionSetupService

        public CompetitionSetupService()
        Standard constructor
    • 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:
        bootSession in interface CompetitionSetup
      • 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:
        preGame in interface CompetitionSetup