trim some ChildrenEvalMethod options
This commit is contained in:
parent
4120c4e7fb
commit
386c8a342e
@ -94,11 +94,6 @@ impl std::fmt::Display for FutureMoveConfig {
|
|||||||
#[derive(Debug, Clone, Copy, Allocative)]
|
#[derive(Debug, Clone, Copy, Allocative)]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub enum ChildrenEvalMethod {
|
pub enum ChildrenEvalMethod {
|
||||||
Average,
|
|
||||||
AverageDivDepth,
|
|
||||||
|
|
||||||
MinAvgDivDepth,
|
|
||||||
|
|
||||||
/// Best so far?
|
/// Best so far?
|
||||||
MinMax,
|
MinMax,
|
||||||
|
|
||||||
@ -322,31 +317,6 @@ impl FutureMoves {
|
|||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let children_value = match self.config.children_eval_method {
|
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 => {
|
ChildrenEvalMethod::MinMax | ChildrenEvalMethod::MinMaxFlat => {
|
||||||
if self.arena[idx].color == self.agent_color {
|
if self.arena[idx].color == self.agent_color {
|
||||||
// get best (for the adversary) enemy play
|
// get best (for the adversary) enemy play
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user