This commit is contained in:
2025-03-03 23:50:11 -05:00
parent d48670dbdb
commit e8521ac96d
2 changed files with 54 additions and 23 deletions

View File

@@ -17,16 +17,12 @@ pub fn run() {
min_arena_depth: 14,
top_k_children: 2,
up_to_minus: 10,
max_arena_size: usize::MAX,
max_arena_size: 1_000_000,
do_not_prune: true,
print: false,
};
let mut arena = PlayerArena::new(vec![
// (
// "RandomAgent".into(),
// Box::new(|piece| Box::new(RandomAgent::new(piece))),
// ),
(
"ComplexAgentD1".into(),
Box::new(|piece| {
@@ -39,6 +35,18 @@ pub fn run() {
))
}),
),
(
"ComplexAgentD2".into(),
Box::new(|piece| {
Box::new(ComplexAgent::new(
piece,
FutureMoveConfig {
max_depth: 2,
..FMV_BASE
},
))
}),
),
(
"ComplexAgentD3".into(),
Box::new(|piece| {
@@ -52,24 +60,24 @@ pub fn run() {
}),
),
(
"ComplexAgentD8".into(),
"ComplexAgentD4".into(),
Box::new(|piece| {
Box::new(ComplexAgent::new(
piece,
FutureMoveConfig {
max_depth: 8,
max_depth: 4,
..FMV_BASE
},
))
}),
),
// (
// "ComplexAgent5M".into(),
// "ComplexAgentD8".into(),
// Box::new(|piece| {
// Box::new(ComplexAgent::new(
// piece,
// FutureMoveConfig {
// max_arena_size: 5_000_000,
// max_depth: 8,
// ..FMV_BASE
// },
// ))
@@ -77,17 +85,9 @@ pub fn run() {
// ),
]);
// arena.play(
// &(0..arena.players.len())
// .zip([0].into_iter().cycle())
// .filter(|(i, j)| i != j)
// .collect::<Vec<_>>()
// .repeat(1000),
// );
for _ in 0..10 {
arena.prop_arena(2);
println!("{}", arena);
}
arena.prop_arena(1000);
println!("{}", arena);
}
pub struct PlayerArena {
@@ -176,8 +176,13 @@ impl PlayerArena {
}
fn play_two_inner(player_1: Box<dyn Agent>, player_2: Box<dyn Agent>) -> Outcomes {
let result =
GameInner::new(player_1, player_2, false, Board::random(5)).loop_until_result();
let result = GameInner::new(
player_1,
player_2,
false,
Board::random(rand::random_range(3..8)),
)
.loop_until_result();
match result {
Winner::Player(piece) => match piece {