initial rewrite of lazy_children logic
This commit is contained in:
@@ -86,4 +86,11 @@ impl Move {
|
||||
|
||||
BVM.board_value(&self.board, agent_color)
|
||||
}
|
||||
|
||||
/// Sort children of the [`Move`] by their self_value in `arena`
|
||||
pub fn sort_children(&mut self, arena: &[Move]) {
|
||||
// negative, because we want the max value to be at the first index
|
||||
// abs because we want the most EXTREME possible outcome (win or lose for example)
|
||||
self.children.sort_by_key(|&i| -arena[i].self_value.abs());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user