core

## Class ArcadeMachine

- java.lang.Object
- - core.ArcadeMachine

-     public class ArcadeMachine
      extends java.lang.Object

  Created with IntelliJ IDEA. User: Diego Date: 06/11/13 Time: 11:24 This is a Java port from Tom Schaul's VGDL - https://github.com/schaul/py-vgdl

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `VERBOSE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ArcadeMachine()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static AbstractPlayer` | `createController(java.lang.String playerName, StateObservation so)` Creates and initializes a new controller with the given name.
    `static double` | `playOneGame(java.lang.String game_file, java.lang.String level_file, java.lang.String actionFile, int randomSeed)` Reads and launches a game for a human to be played.
    `static double` | `replayGame(java.lang.String game_file, java.lang.String level_file, boolean visuals, java.lang.String actionFile)` Runs a replay given a game, level and file with the actions to execute.
    `static void` | `runGames(java.lang.String game_file, java.lang.String[] level_files, int level_times, java.lang.String agentName, java.lang.String[] actionFiles, int randomSeed)` Reads and launches a game for a bot to be played.
    `static double` | `runOneGame(java.lang.String game_file, java.lang.String level_file, boolean visuals, java.lang.String agentName, java.lang.String actionFile, int randomSeed)` Reads and launches a game for a bot to be played.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### VERBOSE

          public static final boolean VERBOSE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ArcadeMachine

          public ArcadeMachine()

  - ### Method Detail

    - #### playOneGame

          public static double playOneGame(java.lang.String game_file,
                           java.lang.String level_file,
                           java.lang.String actionFile,
                           int randomSeed)

      Reads and launches a game for a human to be played. Graphics always on.
      Parameters:
        `game_file` - game description file.
        `level_file` - file with the level to be played.

    - #### runOneGame

          public static double runOneGame(java.lang.String game_file,
                          java.lang.String level_file,
                          boolean visuals,
                          java.lang.String agentName,
                          java.lang.String actionFile,
                          int randomSeed)

      Reads and launches a game for a bot to be played. Graphics can be on or off.
      Parameters:
        `game_file` - game description file.
        `level_file` - file with the level to be played.
        `visuals` - true to show the graphics, false otherwise.
        `agentName` - name (inc. package) where the controller is otherwise.
        `actionFile` - filename of the file where the actions of this player, for this game, should be recorded.
        `randomSeed` - sampleRandom seed for the sampleRandom generator.

    - #### replayGame

          public static double replayGame(java.lang.String game_file,
                          java.lang.String level_file,
                          boolean visuals,
                          java.lang.String actionFile)

      Runs a replay given a game, level and file with the actions to execute.
      Parameters:
        `game_file` - game description file.
        `level_file` - file with the level to be played.
        `visuals` - true to show the graphics, false otherwise.
        `actionFile` - name of the file where the actions of this player, for this game, must be read from.

    - #### runGames

          public static void runGames(java.lang.String game_file,
                      java.lang.String[] level_files,
                      int level_times,
                      java.lang.String agentName,
                      java.lang.String[] actionFiles,
                      int randomSeed)

      Reads and launches a game for a bot to be played. It specifies which levels to play and how many times. Filenames for saving actions can be specified. Graphics always off.
      Parameters:
        `game_file` - game description file.
        `level_files` - array of level file names to play.
        `level_times` - how many times each level has to be played.
        `actionFiles` - names of the files where the actions of this player, for this game, should be recorded. Accepts null if no recording is desired. If not null, this array must contain as much String objects as level_files.length*level_times.

    - #### createController

          protected static AbstractPlayer createController(java.lang.String playerName,
                                        StateObservation so)
                                                    throws java.lang.RuntimeException

      Creates and initializes a new controller with the given name. Takes into account the initialization time, calling the appropriate constructor with the state observation and time due parameters.
      Parameters:
        `playerName` - Name of the controller to instantiate.
        `so` - Initial state of the game to be played by the agent.
      Returns:
        the player if it could be created, null otherwise.
      Throws:
        `java.lang.RuntimeException`