public class ArcadeMachine
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static StatSummary |
performance |
static boolean |
VERBOSE |
Constructor and Description |
---|
ArcadeMachine() |
Modifier and Type | Method and Description |
---|---|
protected static Player |
createController(java.lang.String playerName,
int playerID,
StateObservation so)
Creates and initializes a new controller with the given name.
|
static AbstractMultiPlayer |
createMultiPlayer(java.lang.String playerName,
java.lang.String actionFile,
StateObservationMulti so,
int randomSeed,
int id,
boolean isHuman)
Creates a player given its name with package for multiplayer.
|
static AbstractPlayer |
createPlayer(java.lang.String playerName,
java.lang.String actionFile,
StateObservation so,
int randomSeed,
boolean isHuman)
Creates a player given its name with package.
|
static boolean |
isHuman(java.lang.String agentName) |
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[] |
playOneGameMulti(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)
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 agentNames,
java.lang.String actionFile,
int randomSeed,
int playerID)
Reads and launches a game for a bot to be played.
|
static boolean |
tearPlayerDown(Game toPlay,
Player[] players,
java.lang.String actionFile,
int randomSeed,
boolean record)
Tears the player down.
|
static void |
warmUp(Game toPlay,
long howLong)
This methods takes the game and warms it up.
|
public static final boolean VERBOSE
public static StatSummary performance
public static double[] playOneGame(java.lang.String game_file, java.lang.String level_file, java.lang.String actionFile, int randomSeed)
game_file
- game description file.level_file
- file with the level to be played.public static double[] playOneGameMulti(java.lang.String game_file, java.lang.String level_file, java.lang.String actionFile, int randomSeed)
game_file
- game description file.level_file
- file with the level to be played.actionFile
- to save the actions of the game.randomSeed
- for the game to be played.public static double[] runOneGame(java.lang.String game_file, java.lang.String level_file, boolean visuals, java.lang.String agentNames, java.lang.String actionFile, int randomSeed, int playerID)
game_file
- game description file.level_file
- file with the level to be played.visuals
- true to show the graphics, false otherwise.agentNames
- names (inc. package) where the tracks are otherwise.
Names separated by space.actionFile
- filename of the files where the actions of these players, for
this game, should be recorded.randomSeed
- sampleRandom seed for the sampleRandom generator.playerID
- ID of the human playerpublic static double[] replayGame(java.lang.String game_file, java.lang.String level_file, boolean visuals, java.lang.String actionFile)
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 these players, for this
game, must be read from. If the game is multi player, this
file contains meta game information (winner, scores,
timesteps, random seed) and names of all the files for player
actions.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)
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.public static AbstractPlayer createPlayer(java.lang.String playerName, java.lang.String actionFile, StateObservation so, int randomSeed, boolean isHuman)
playerName
- name of the agent to create. It must be of the type
"actionFile
- filename of the file where the actions of this player, for
this game, should be recorded.so
- Initial state of the game to be played by the agent.randomSeed
- Seed for the sampleRandom generator of the game to be played.isHuman
- Indicates if the player is humanpublic static AbstractMultiPlayer createMultiPlayer(java.lang.String playerName, java.lang.String actionFile, StateObservationMulti so, int randomSeed, int id, boolean isHuman)
playerName
- name of the agent to create. It must be of the type
"actionFile
- filename of the file where the actions of this player, for
this game, should be recorded.so
- Initial state of the game to be played by the agent.randomSeed
- Seed for the sampleRandom generator of the game to be played.isHuman
- Indicates if the player is humanprotected static Player createController(java.lang.String playerName, int playerID, StateObservation so) throws java.lang.RuntimeException
playerName
- Name of the controller to instantiate.so
- Initial state of the game to be played by the agent.java.lang.RuntimeException
public static void warmUp(Game toPlay, long howLong)
toPlay
- game to be warmed up.howLong
- for how long the warming up process must last (in
milliseconds).public static boolean tearPlayerDown(Game toPlay, Player[] players, java.lang.String actionFile, int randomSeed, boolean record)
toPlay
- game played.players
- players to be closed.actionFile
- file where players' actions should be saved.randomSeed
- random seed of the game.record
- boolean, true if actions should be recorded, false otherwisepublic static final boolean isHuman(java.lang.String agentName)