diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-07-10 20:50:36 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-07-10 20:50:36 +0200 |
commit | 1a1f1a6c2be2986c7ca938aea27ff36e726549e9 (patch) | |
tree | c3d722ae85ee27323340f954acd40ee0ac2057f1 | |
parent | b9983669d07ff590d002fb8b4637bc08fa880907 (diff) |
Marked the position to do pruning
-rw-r--r-- | src/strategy/minimax.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/strategy/minimax.rs b/src/strategy/minimax.rs index 31e58a0..e620339 100644 --- a/src/strategy/minimax.rs +++ b/src/strategy/minimax.rs @@ -124,7 +124,6 @@ impl AddAssign<Score> for ScoreSum { } } -// TODO: Transform this into more of a minimax with AB pruning approach? fn expand_tree(node: &mut Node, state: &GameBoard) -> Score { if state.outcome != SimulationOutcome::Continue { score(state) @@ -146,6 +145,10 @@ fn expand_tree(node: &mut Node, state: &GameBoard) -> Score { }; node.children.insert(commands, new_node); + if node.unexplored.is_empty() { + // TODO: Prune dominated moves + } + update(node, commands, score); score } else { |