Make mvv_lva to map pieces to their material score instead of abritrary matrix

Add time limits, use anyhow crate to improve error handling, remove depth limit on quiescence search
This commit is contained in:
stefiosif
2024-11-13 21:13:05 +02:00
parent 429485ae73
commit c2414c3f6e
11 changed files with 207 additions and 128 deletions

View File

@@ -1,14 +1,30 @@
use crate::movegen::r#move::Move;
pub mod iterative_deepening;
pub mod move_ordering;
pub mod negamax;
pub mod perft;
pub mod quiescence;
pub mod time;
pub mod transposition_table;
pub const MAX_DEPTH: u8 = 7;
pub const QUIESCENCE_DEPTH: u8 = 3;
pub const REMAINING_TIME_DEFAULT: u128 = 100000; // in ms
pub const HARD_LIMIT_DIVISION: u128 = 10;
pub const SOFT_LIMIT_DIVISION: u128 = 2;
pub const SOFT_LIMIT_DIVISION: u128 = 20;
pub const SOFT_EVAL_THRESHOLD: i32 = 500;
pub const MAX_TT_SIZE: u64 = 1000000;
pub const MAX_TT_SIZE: u64 = 2000000;
pub struct SearchResult {
pub best_move: Option<Move>,
pub best_score: i32,
}
impl SearchResult {
pub const fn new(best_move: Option<Move>, best_score: i32) -> Self {
Self {
best_move,
best_score,
}
}
}