[−][src]Module connect6::policy
Predefined policy for agent to play game.
Policy represents algorithm that make choice in given situation. This module provides 5 predefined policies, AlphaZero policy, random policy, io policy, multi-policy and pure MCTS policy.
- Policy : trait for playing game with
Agent
. - AlphaZero : implementation of policy AlphaZero.
- RandomPolicy : select possible position with randomness.
- IoPolicy : read user input.
- MultiPolicy : Black-White seperable policy, pass two different policies as initialize parameter.
- DefaultPolicy : Pure Monte Carlo tree search implementation.
Examples
struct ZeroPolicy {} impl Policy for ZeroPolicy { fn next(&mut self, game: &Game) -> Option<(usize, usize)> { Some((0, 0)) } } let mut policy = ZeroPolicy {}; let result = Agent::new(&mut policy).play(); assert!(result.is_err());
Structs
AlphaZero | Implementation of policy |
DefaultPolicy | Policy for pure Monte Carlo tree search implementation |
HyperParameter | Hyperparameter for implementing |
IoPolicy | Policy for in-game user selection with io |
MultiPolicy | Black-White seperable policy |
Node | Shared memory for making simulation wihout copying board and possible selections. |
RandomEvaluator | Evaluator for test, Random Value Evaluator |
RandomPolicy | Play game with random selection. |
Simulate | Game simulator with shared memory for efficient tree searching |
Traits
Evaluator | Evaluator for applying value, policy approximator to |
Policy | trait for playing game with Agent. |
Functions
diff_board | compare the board and return the difference between position by position. |
hash | generate hash value of board |