commit old stuff
This commit is contained in:
parent
ef2e551085
commit
4ca6dfc572
@ -30,7 +30,7 @@ pub fn run() {
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let configs = [6]
|
||||
let configs = [2, 3, 4, 5, 6, 7, 8]
|
||||
.into_iter()
|
||||
.map(move |d| FutureMoveConfig {
|
||||
max_depth: d,
|
||||
@ -121,7 +121,7 @@ pub fn run() {
|
||||
})
|
||||
.collect();
|
||||
|
||||
if true {
|
||||
if false {
|
||||
vec.push((
|
||||
"RandomAgent".to_string(),
|
||||
Box::new(move |piece| Box::new(RandomAgent::new(piece))),
|
||||
|
@ -311,6 +311,7 @@ impl FutureMoves {
|
||||
match self.config.children_eval_method {
|
||||
ChildrenEvalMethod::MinMax => {
|
||||
self.arena[idx].value.value += child_value.value;
|
||||
self.arena[idx].value.set_state(child_value.state());
|
||||
}
|
||||
ChildrenEvalMethod::MinMaxProb => {
|
||||
self.arena[idx]
|
||||
@ -367,7 +368,7 @@ impl FutureMoves {
|
||||
ChildrenEvalMethod::MinMax => self.arena[x]
|
||||
.children
|
||||
.iter()
|
||||
.max_by_key(|&&idx| self.arena[idx].value.value),
|
||||
.max_by_key(|&&idx| self.arena[idx].value),
|
||||
ChildrenEvalMethod::MinMaxProb => self.arena[x]
|
||||
.children
|
||||
.iter()
|
||||
|
@ -56,6 +56,10 @@ impl MoveValueStats {
|
||||
self.state = state;
|
||||
}
|
||||
|
||||
pub const fn state(&self) -> Option<MVSGameState> {
|
||||
self.state
|
||||
}
|
||||
|
||||
pub fn populate_self_from_children(&mut self, others: &[Self]) {
|
||||
(self.wins, self.losses, self.ties) =
|
||||
others.iter().fold((0, 0, 0), |(wins, losses, ties), x| {
|
||||
|
Loading…
x
Reference in New Issue
Block a user