trim some ChildrenEvalMethod options

This commit is contained in:
Simon Gardling 2025-04-20 01:57:57 -04:00
parent 4120c4e7fb
commit 386c8a342e
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -94,11 +94,6 @@ impl std::fmt::Display for FutureMoveConfig {
#[derive(Debug, Clone, Copy, Allocative)]
#[allow(dead_code)]
pub enum ChildrenEvalMethod {
Average,
AverageDivDepth,
MinAvgDivDepth,
/// Best so far?
MinMax,
@ -322,31 +317,6 @@ impl FutureMoves {
.collect::<Vec<_>>();
let children_value = match self.config.children_eval_method {
ChildrenEvalMethod::Average => children_values
.into_iter()
.sum::<i32>()
.checked_div(self.arena[idx].children.len() as i32),
ChildrenEvalMethod::AverageDivDepth => children_values
.into_iter()
.sum::<i32>()
.checked_div(self.arena[idx].children.len() as i32)
.and_then(|x| x.checked_div(depth as i32)),
ChildrenEvalMethod::MinAvgDivDepth => {
if self.arena[idx].color == self.agent_color {
// get best (for the adversary) enemy play
// this assumes the adversary is playing optimally
children_values.into_iter().min()
} else {
children_values
.into_iter()
.sum::<i32>()
.checked_div(self.arena[idx].children.len() as i32)
.and_then(|x| x.checked_div(depth as i32))
}
}
ChildrenEvalMethod::MinMax | ChildrenEvalMethod::MinMaxFlat => {
if self.arena[idx].color == self.agent_color {
// get best (for the adversary) enemy play