aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/board/engine.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs
index ed533df..65851cf 100644
--- a/src/board/engine.rs
+++ b/src/board/engine.rs
@@ -153,7 +153,7 @@ impl Board {
}
/// Returns the weighted sum of distances from attacking pieces to a king
- /// The higher this value, the more likely the king is to be in danger
+ /// The higher this value, the safer is the king
pub fn king_tropism(&self, color: Color) -> f32 {
let mut result = 0.0;
@@ -169,7 +169,7 @@ impl Board {
(king_square.rank() as f32 - square.rank() as f32).abs() +
(king_square.file() as f32 - square.file() as f32).abs();
- result += distance * PieceType::from(piece_type).static_eval();
+ result += distance / PieceType::from(piece_type).static_eval();
}
}
}
@@ -195,7 +195,7 @@ impl Board {
let king_tropism_penalty = self.king_tropism(color) - self.king_tropism(opponent_color);
- material_advantage + 0.1 * mobility_advantage - 0.5 * pawn_structure_penalty - king_tropism_penalty * opponent_material / 3000.0
+ material_advantage + 0.1 * mobility_advantage - 0.5 * pawn_structure_penalty + king_tropism_penalty * opponent_material / 100.0
}
/// Evaluate move for move ordering, prioritizing efficient captures