Interface CompetitionSetup


  • public interface CompetitionSetup
    Handles the pre-game competition setup process. To start a simulation, one must call preGame(), followed by CompetitionControl.runOnce().
    Author:
    John Collins
    • Method Detail

      • preGame

        void preGame()
        Runs the pre-game cycle of the simulator, which sets all plugin components to their default state.
      • bootSession

        String bootSession​(String bootFilename,
                           String configFilename,
                           String gameId,
                           String logfileSuffix,
                           String seedData,
                           String weatherData)
        Starts a bootstrap session with parameters. Result is null if successful, otherwise contains an error message. Parameters are:
        • bootFilename is the (required) name of an output file where the bootstrap dataset will be stored.
        • configFilename is the (optional) name of a server-configuration file; if the name contains a ":" it will be treated as a URL.
        • gameId is an (optional) game id, the default is a numerical session counter.
        • logfileSuffix is an (optional) filename suffix for the log output files; default value is "boot".
        • seedData is a state log from which random-number seeds will be extracted.
        • weatherData is the (optional) name of a file containing weather data for the simulation. It may be either XMl or a state file. A state file will be treated as a URL if it contains a ":" character.
        • configOutput is an optional filename to which the full server configuration will be dumped during the configuration process.
      • simSession

        String simSession​(String bootData,
                          String config,
                          String jmsUrl,
                          String gameId,
                          String logfileSuffix,
                          List<String> brokerUsernames,
                          String seedData,
                          String weatherData,
                          String inputQueueName)
        Starts a simulation session with parameters, in a new thread. Result is null if successful, otherwise contains an error message. Parameters are:
        • bootData is the (required) name of an input file containing a bootstrap dataset for the simulation; it will be treated as a URL if it contains a ":" character.
        • config is the (optional) name of a server-configuration file; if the name contains a ":" it will be treated as a URL.
        • jmsUrl is the URL on which the server should listen for JMS connections. This is required if the server is to interact with brokers on separate machines. If given, all brokers must use this URL to contact the server.
        • gameId is an (optional) game id, the default is a numerical session counter.
        • logfileSuffix is an (optional) filename suffix for the log output files; default value is "sim".
        • brokerUsernames is a list of Strings giving the usernames of brokers who are expected to log in to the simulation before it starts. If a username is of the form string1/string2, then string1 is the broker's username, and string2 is the name of that broker's JMS input queue. If this argument is null or empty, the simulation will start without brokers.
        • seedData is the (optional) name of a file containing seed data for the simulation; it will be treated as a URL if it contains a ":" character.
        • weatherData is the (optional) name of a file containing weather data for the simulation; Either XMl or a state file A state file will be treated as a URL if it contains a ":" character.
        • inputQueueName is the name of the server's JMS input queue. If not given, then the default value of 'serverInput' will be used.
        • configOutput is an optional filename to which the full server configuration will be dumped during the configuration process.