public class LearningMachine
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static StatSummary |
performance
Reads and launches a game for a bot to be played.
|
static boolean |
VERBOSE |
Constructor and Description |
---|
LearningMachine() |
Modifier and Type | Method and Description |
---|---|
static int |
playOneLevel(java.lang.String game_file,
java.lang.String level_file,
int level_time,
boolean isValidation,
boolean isVisual,
boolean recordActions,
int levelIdx,
LearningPlayer[] players,
java.lang.String[] actionFiles,
Game toPlay,
StatSummary[] scores,
StatSummary[] victories)
Method used to play a single given level.
|
static void |
runGames(java.lang.String game_file,
java.lang.String[] level_files,
int level_times,
LearningPlayer player,
java.lang.String[] actionFiles,
boolean visual) |
static void |
runMultipleGames(java.lang.String game_file,
java.lang.String[] level_files,
java.lang.String[] cmd,
java.lang.String[] actionFiles,
boolean visuals)
Reads and launches a game to be played on a series of both pre-determined and non
pre-determined levels.
|
static double[] |
runOneGame(java.lang.String game_file,
java.lang.String level_file,
boolean visuals,
java.lang.String[] cmd,
java.lang.String actionFile,
int randomSeed)
Reads and launches a game for an agent to be played.
|
public static final boolean VERBOSE
public static StatSummary performance
public static double[] runOneGame(java.lang.String game_file, java.lang.String level_file, boolean visuals, java.lang.String[] cmd, java.lang.String actionFile, int randomSeed) throws java.io.IOException
game_file
- game description file.level_file
- file with the level to be played.visuals
- true to show the graphics, false otherwise. Training games have never graphics set to ON.cmd
- array with name of the script file to run for the client, plus agent and portactionFile
- filename of the file where the actions of this player, for this game, should be recorded.randomSeed
- sampleRandom seed for the sampleRandom generator.java.io.IOException
public static void runMultipleGames(java.lang.String game_file, java.lang.String[] level_files, java.lang.String[] cmd, java.lang.String[] actionFiles, boolean visuals) throws java.io.IOException
game_file
- game description file.level_files
- file with the level to be played.cmd
- array with name of the script file to run for the client, plus agent and portactionFiles
- filename of the file where the actions of this player, for this game, should be recorded.java.io.IOException
public static void runGames(java.lang.String game_file, java.lang.String[] level_files, int level_times, LearningPlayer player, java.lang.String[] actionFiles, boolean visual) throws java.io.IOException
java.io.IOException
public static int playOneLevel(java.lang.String game_file, java.lang.String level_file, int level_time, boolean isValidation, boolean isVisual, boolean recordActions, int levelIdx, LearningPlayer[] players, java.lang.String[] actionFiles, Game toPlay, StatSummary[] scores, StatSummary[] victories) throws java.io.IOException
game_file
- Game file to be used to play the game. Is sent by parent method.level_file
- Level file to be used to play the game. Is sent by parent method.level_time
- Integer denominating how many times the current level has been played in a row.
Is also sent from the exterior, and exists for debugging only.isValidation
- Indicates if the level being played is a validation levelrecordActions
- Boolean determining whether the actions should be recorded.levelIdx
- Level index. Used for debugging.players
- Array of Player-type objects. Used to play the gameactionFiles
- Files used to record the actions in for logging purposes.toPlay
- The game to be played. Must be pre-initialized.scores
- Array of scores to be modified. Is modified at the end of the level.victories
- Array of victories to be modified. Is modified at the end of the level.java.io.IOException