GAIGResearch / TabletopGames

MIT License
80 stars 68 forks source link

Monte Carlo Graph Search #269

Closed hopshackle closed 9 months ago

hopshackle commented 11 months ago

An implementation of Monte Carlo Graph Search in TAG

This is implemented as a new agent. Instead of building a Tree based on an Open Loop assumption that the history of actions from the root defines the state, it requires a vectorised or String summarisation of the game state. A HashMap is then used to store the node statistics (the values), using the String look up (key).

Every time an agent has to make a decision it converts the current state to the String/Vectorised summary and looks this up in the HashMap. If a node exists, then we use this to determine the next action (Tree phases). If no node exists then we Expand a new one, and enter Rollout. [roughly..there is nuance in the detail]

This required some refactoring of MCTS to give what I think is a more natural structure, and allow more code to be shared between the two. (No changes are made to BasicMCTS.)