move FutureMoveConfig usage into main.rs
This commit is contained in:
parent
10389ad8ee
commit
2388ee8c75
@ -11,17 +11,10 @@ pub struct ComplexAgent {
|
|||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
impl ComplexAgent {
|
impl ComplexAgent {
|
||||||
pub const fn new(color: Piece) -> Self {
|
pub const fn new(color: Piece, config: FutureMoveConfig) -> Self {
|
||||||
const CONFIG: FutureMoveConfig = FutureMoveConfig {
|
|
||||||
max_depth: 20,
|
|
||||||
min_arena_depth_sub: 3,
|
|
||||||
top_k_children: 2,
|
|
||||||
up_to_minus: usize::MAX, // disable pruning
|
|
||||||
max_arena_size: 50_000_000,
|
|
||||||
};
|
|
||||||
Self {
|
Self {
|
||||||
color,
|
color,
|
||||||
future_moves: FutureMoves::new(color, CONFIG),
|
future_moves: FutureMoves::new(color, config),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/main.rs
23
src/main.rs
@ -1,4 +1,5 @@
|
|||||||
use game::Game;
|
use game::Game;
|
||||||
|
use logic::FutureMoveConfig;
|
||||||
use repr::Piece;
|
use repr::Piece;
|
||||||
|
|
||||||
mod agent;
|
mod agent;
|
||||||
@ -9,8 +10,26 @@ pub mod repr;
|
|||||||
|
|
||||||
// TODO! make this agent configuration a config option via `clap-rs`
|
// TODO! make this agent configuration a config option via `clap-rs`
|
||||||
fn main() {
|
fn main() {
|
||||||
let player1 = complexagent::ComplexAgent::new(Piece::Black);
|
let player1 = complexagent::ComplexAgent::new(
|
||||||
// let player2 = complexagent::ComplexAgent::new(Piece::White);
|
Piece::Black,
|
||||||
|
FutureMoveConfig {
|
||||||
|
max_depth: 20,
|
||||||
|
min_arena_depth_sub: 3,
|
||||||
|
top_k_children: 2,
|
||||||
|
up_to_minus: usize::MAX, // disable pruning
|
||||||
|
max_arena_size: 50_000_000,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
// let player2 = complexagent::ComplexAgent::new(
|
||||||
|
// Piece::White,
|
||||||
|
// FutureMoveConfig {
|
||||||
|
// max_depth: 20,
|
||||||
|
// min_arena_depth_sub: 3,
|
||||||
|
// top_k_children: 2,
|
||||||
|
// up_to_minus: 5, // disable pruning
|
||||||
|
// max_arena_size: 2_000_000,
|
||||||
|
// },
|
||||||
|
// );
|
||||||
let player2 = agent::ManualAgent::new(Piece::White);
|
let player2 = agent::ManualAgent::new(Piece::White);
|
||||||
// let player2 = agent::RandomAgent::new(Piece::White);
|
// let player2 = agent::RandomAgent::new(Piece::White);
|
||||||
let mut game = Game::new(Box::new(player1), Box::new(player2));
|
let mut game = Game::new(Box::new(player1), Box::new(player2));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user