Post by Lars Ericson on Jul 18, 2015 7:56:58 GMT -8
I have a simple Monte Carlo DAG player and I want to add, not a propnet player, but GDL -> PropNet + Current State -> Simplification -> GDL and then put that GDL into a StateMachine player, at every move. And rebuild my DAG only if the PropNet gets simplified, otherwise re-use the DAG accumulated from Monte Carlo. Also, as I go along this strategy, I want to see pictures of my propnet as a graph to get some intuition.
I am trying to figure out where in GGP Base the StateMachine is built from the GDL. Also where I can take a GDL and turn it into a PropNet.
PlayerTester.java has function getMediasResGame which takes a game and a desired initial state, and rewrites
the game rules so that the game begins in that initial state. The game stores the rule sheet as text. It will convert the text to GDL with function getRules in Game.java.
ImportSanchoCases.java gives some idea of how to set up a state machine given a rule sheet. Game String -> Game -> GDL -> StateMachine:
StateMachine theMachine = new ProverStateMachine();
theMachine.initialize(PlayerTester.getMediasResGame(gameKey, theState).getRules());
List<Move> legalMoves = theMachine.getLegalMoves(theMachine.getInitialState(), theMachine.getRoles().get(thePlayerID));
Now I have to track down initialize. I am subclassing from SampleGamer which uses ProverStateMachine which uses AimaProver.java. I guess that AIMA stands for AI: a Modern Approach and implements the Resolution-based Theorem Prover of Norvig and Russell.
Now I know how to go from GDL -> StateMachine. Now question is how to go from GDL -> PropNet. GGP Base contains OptimizingPropNetFactory.java. Reading the code for this is helpful because the text for the Stanford GGP course is rather confusing. First it uses a Prolog notation instead of the Lisp notation actually used for GDL. Second it is not obvious from the text how to map some terms from GDL to propnet. In particular I can't tell from reading the textbook what to do with role(white) and input(white,a). I guess this will become more obvious by reading OptimizingPropNetFactory.create. This is the method that implements GDL->PropNet.
To get my graph, PropNet.java method toString does the trick.
There are three more pieces to the puzzle:
1. PropNet -> GDL. I guess this will become obvious after I've played with PropNets and visualized them. For now I can just generate a PropNet at each step of a game, graph it, and get an intuition of how the propnet evolves as the state-based game DAG evolves.
2. How to efficiently re-initialize a StateMachine on the fly with a revised GDL at each move. (Plus how long does it take to create a new optimized PropNet at each step.)
3. How to detect if the revised GDL is sufficiently different that I should prune or discard the DAG I've built so far.
I am trying to figure out where in GGP Base the StateMachine is built from the GDL. Also where I can take a GDL and turn it into a PropNet.
PlayerTester.java has function getMediasResGame which takes a game and a desired initial state, and rewrites
the game rules so that the game begins in that initial state. The game stores the rule sheet as text. It will convert the text to GDL with function getRules in Game.java.
ImportSanchoCases.java gives some idea of how to set up a state machine given a rule sheet. Game String -> Game -> GDL -> StateMachine:
StateMachine theMachine = new ProverStateMachine();
theMachine.initialize(PlayerTester.getMediasResGame(gameKey, theState).getRules());
List<Move> legalMoves = theMachine.getLegalMoves(theMachine.getInitialState(), theMachine.getRoles().get(thePlayerID));
Now I have to track down initialize. I am subclassing from SampleGamer which uses ProverStateMachine which uses AimaProver.java. I guess that AIMA stands for AI: a Modern Approach and implements the Resolution-based Theorem Prover of Norvig and Russell.
Now I know how to go from GDL -> StateMachine. Now question is how to go from GDL -> PropNet. GGP Base contains OptimizingPropNetFactory.java. Reading the code for this is helpful because the text for the Stanford GGP course is rather confusing. First it uses a Prolog notation instead of the Lisp notation actually used for GDL. Second it is not obvious from the text how to map some terms from GDL to propnet. In particular I can't tell from reading the textbook what to do with role(white) and input(white,a). I guess this will become more obvious by reading OptimizingPropNetFactory.create. This is the method that implements GDL->PropNet.
To get my graph, PropNet.java method toString does the trick.
There are three more pieces to the puzzle:
1. PropNet -> GDL. I guess this will become obvious after I've played with PropNets and visualized them. For now I can just generate a PropNet at each step of a game, graph it, and get an intuition of how the propnet evolves as the state-based game DAG evolves.
2. How to efficiently re-initialize a StateMachine on the fly with a revised GDL at each move. (Plus how long does it take to create a new optimized PropNet at each step.)
3. How to detect if the revised GDL is sufficiently different that I should prune or discard the DAG I've built so far.