24 lines
555 B
Rust
24 lines
555 B
Rust
mod diffuse;
|
|
mod minmaxtree;
|
|
mod player;
|
|
mod random;
|
|
pub mod util;
|
|
|
|
pub use diffuse::DiffuseAgent;
|
|
pub use minmaxtree::MinMaxTree;
|
|
pub use player::PlayerAgent;
|
|
pub use random::RandomAgent;
|
|
|
|
use crate::board::{Board, PlayerAction};
|
|
use anyhow::Result;
|
|
|
|
/// An agent that tries to minimize the value of a board.
|
|
pub trait MinimizerAgent {
|
|
fn step_min(&mut self, board: &Board) -> Result<PlayerAction>;
|
|
}
|
|
|
|
/// An agent that tries to maximize the value of a board.
|
|
pub trait MaximizerAgent {
|
|
fn step_max(&mut self, board: &Board) -> Result<PlayerAction>;
|
|
}
|