Add log for soft limit reach, tweak values, clippy

This commit is contained in:
stefiosif
2025-01-28 00:21:19 +02:00
parent ccba6451aa
commit 3f08e194f4
3 changed files with 5 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ pub fn iterative_deepening(
for depth in 1..=max_depth {
if time.exceed_soft_limit() {
write_response(&mut io::stdout(), &Response::Info("Soft limit exceeded in negamax".to_string()))?;
return Ok(best_move);
}

View File

@@ -7,8 +7,8 @@ pub mod time;
pub mod transposition_table;
pub const MAX_DEPTH: u8 = 50;
pub const TIME: u128 = 1000;
pub const INC: u128 = 1000;
pub const TIME: u128 = 8000;
pub const INC: u128 = 80;
pub const HARD_LIMIT_DIVISION: u128 = 3;
pub const SOFT_LIMIT_DIVISION: u128 = 20;
pub const MAX_TT_SIZE: u64 = 3000000;
pub const MAX_TT_SIZE: u64 = 1500000;

View File

@@ -15,8 +15,7 @@ impl TranspositionTable {
}
pub fn lookup(&self, zobrist_hash: ZobristHash) -> Option<&TTEntry> {
self
.positions
self.positions
.get((zobrist_hash.0 % self.size) as usize)
.and_then(|entry| entry.as_ref())
}