keithgw / wingspan

A Wingspan AI that uses reinforcement learning to learn to play the wingspan board game.
2 stars 1 forks source link

Refactor action choice to receive state and legal actions #59

Closed keithgw closed 8 months ago

keithgw commented 8 months ago

With the modification to GameState #51 and #52 , BotPlayer importing State from rl is creating a circular import loop.

To solve this, and make the interface for choosing and taking actions more consistent across Player and its subclasses as well as Policy and its subclasses, the legal available actions will determined higher in the decision chain, and the choosers will only be allowed to choose from the legal actions passed.

Typically, the state is not needed for the HumanPlayer (as they infer state from the game render), and the BotPlayer only needs it if its not following the RandomPolicy.

This will solve the circular import loop and make the class interfaces more manageable, readable, and extendable when returning to the MCTS implementation.

keithgw commented 8 months ago

60