-
Notifications
You must be signed in to change notification settings - Fork 48
Running & Testing Rule Generators
These instructions describes the steps need to run and test either a sample rule generator or your own rule generator.
Comment any code in tracks/ruleGeneration/TestRuleGeneration.java
that is related to running the game or generating rules for games. Make sure that is the only line uncommented.
// ArcadeMachine.playOneGame(recordGameFile, level1, recordActionsFile, seed);
// ArcadeMachine.runOneGame(recordGameFile, level1, visuals, sampleMCTSController, recordActionsFile, seed, 0);
Uncomment the following line of code in tracks/ruleGeneration/TestRuleGeneration.java
// 1. Generate rules (Interaction and Terminations) for a fixed level
RuleGenMachine.generateRules(game, level1, randomRuleGenerator, recordGameFile, seed);
This code will generate a new VGDL file with the same name as the tested game followed by _ggame.txt
. This file can be found in examples/gridphysics/
folder.
Replace the third function parameter (e.g. randomRuleGenerator
in the previous example) by any of the following variables:
+randomRuleGenerator
+constructiveRuleGenerator
+geneticRuleGenerator
Uncomment any of the following lines to test the current generator
ArcadeMachine.playOneGame(recordGameFile, level1, recordActionsFile, seed);
// ArcadeMachine.runOneGame(recordGameFile, level1, visuals, sampleMCTSController, recordActionsFile, seed, 0);
The first line allows you to test the generated game by yourself, while the second one uses sampleMCTSController
to play the game.
Comment any code in tracks/ruleGeneration/TestRuleGeneration.java
that is related to running the game or generating rules for games. Make sure that is the only line uncommented.
// ArcadeMachine.playOneGame(recordGameFile, level1, recordActionsFile, seed);
// ArcadeMachine.runOneGame(recordGameFile, level1, visuals, sampleMCTSController, recordActionsFile, seed, 0);
Uncomment the following line of code in tracks/ruleGeneration/TestRuleGeneration.java
// 1. Generate rules (Interaction and Terminations) for a fixed level
RuleGenMachine.generateRules(game, level1, randomRuleGenerator, recordGameFile, seed);
This code will generate a new VGDL file with the same name as the tested game followed by _ggame.txt
. This file can be found in examples/gridphysics/
folder.
Replace the third function parameter (e.g. randomRuleGenerator
in the previous example) by the full namespace of your custom RuleGenerator
class. For example lets say your generator namespace is tracks.ruleGeneration.customRuleGenerator.RuleGenerator
. Your rule generation code in tracks/ruleGeneration/TestRuleGeneration.java
will look like the following:
// 1. Generate rules (Interaction and Terminations) for a fixed level
RuleGenMachine.generateRules(game, level1, "tracks.ruleGeneration.customRuleGenerator.RuleGenerator", recordGameFile, seed);
Uncomment any of the following lines to test the current generator
ArcadeMachine.playOneGame(recordGameFile, level1, recordActionsFile, seed);
// ArcadeMachine.runOneGame(recordGameFile, level1, visuals, sampleMCTSController, recordActionsFile, seed, 0);
The first line allows you to test the generated game by yourself, while the second one uses sampleMCTSController
to play the game.
-
GVG Framework
- Tracks Description
- Code Structure
- Creating Controllers
- Creating Multi Player Controllers
- Creating Level Generators
- Running & Testing Level Generators
- Creating Rule Generators
- Running & Testing Rule Generators
-
Forward Model and State Observation
- Advancing and copying the state
- Advancing and copying the state (2 Player)
- Querying the state of the game
- Querying the state of the game (2 Player)
- Information about the state of the Avatar
- Information about the state of the Avatar (2 Player)
- Information about events happened in the game
- Information about other sprites in the game
- Game Description Class
- Constraints
- Game Analyzer Class
- Level Analyzer Class
- Sprite Level Description Class
- Sprite, Termination, and Interaction Data Class
- Level Mapping Class
- Competition Specifications
- VGDL Language