initial implementation of MoveValueStats
This commit is contained in:
26
src/elo.rs
26
src/elo.rs
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
agent::{Agent, RandomAgent},
|
||||
agent::Agent,
|
||||
complexagent::ComplexAgent,
|
||||
game_inner::GameInner,
|
||||
logic::{ChildrenEvalMethod, FutureMoveConfig},
|
||||
@@ -29,7 +29,7 @@ pub fn run() {
|
||||
children_eval_method: Default::default(),
|
||||
};
|
||||
|
||||
let configs = [6]
|
||||
let configs = [4, 5, 6]
|
||||
.into_iter()
|
||||
.map(move |d| FutureMoveConfig {
|
||||
max_depth: d,
|
||||
@@ -71,9 +71,11 @@ pub fn run() {
|
||||
.to_vec()
|
||||
})
|
||||
.flat_map(move |prev_c| {
|
||||
[ChildrenEvalMethod::MinMax].map(move |method| FutureMoveConfig {
|
||||
children_eval_method: method,
|
||||
..prev_c
|
||||
[ChildrenEvalMethod::MinMax, ChildrenEvalMethod::MinMaxProb].map(move |method| {
|
||||
FutureMoveConfig {
|
||||
children_eval_method: method,
|
||||
..prev_c
|
||||
}
|
||||
})
|
||||
})
|
||||
.flat_map(move |prev_c| {
|
||||
@@ -108,7 +110,7 @@ pub fn run() {
|
||||
.collect()
|
||||
});
|
||||
|
||||
let mut vec: Vec<(String, AgentMaker)> = configs
|
||||
let vec: Vec<(String, AgentMaker)> = configs
|
||||
.into_iter()
|
||||
.map(move |config| -> (String, AgentMaker) {
|
||||
(
|
||||
@@ -117,14 +119,14 @@ pub fn run() {
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
vec.push((
|
||||
"RandomAgent".to_string(),
|
||||
Box::new(move |piece| Box::new(RandomAgent::new(piece))),
|
||||
));
|
||||
// vec.push((
|
||||
// "RandomAgent".to_string(),
|
||||
// Box::new(move |piece| Box::new(RandomAgent::new(piece))),
|
||||
// ));
|
||||
|
||||
let mut arena = PlayerArena::new(vec);
|
||||
|
||||
arena.prop_arena(100);
|
||||
arena.prop_arena(1000);
|
||||
|
||||
println!("{}", arena);
|
||||
}
|
||||
@@ -287,7 +289,7 @@ impl PlayerArena {
|
||||
player_1,
|
||||
player_2,
|
||||
false,
|
||||
Board::random(rand::random_range(3..=7)),
|
||||
Board::random(rand::random_range(1..=15)),
|
||||
)
|
||||
.expect("unable to create game")
|
||||
.loop_until_result();
|
||||
|
||||
Reference in New Issue
Block a user