mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-18 08:07:08 +08:00
Use VALUE_DRAW instead of VALUE_ZERO where better
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -367,12 +367,12 @@ Value EvaluationFunction<KBBKN>::apply(const Position& pos) const {
|
|||||||
/// king alone are always draw.
|
/// king alone are always draw.
|
||||||
template<>
|
template<>
|
||||||
Value EvaluationFunction<KmmKm>::apply(const Position&) const {
|
Value EvaluationFunction<KmmKm>::apply(const Position&) const {
|
||||||
return VALUE_ZERO;
|
return VALUE_DRAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
Value EvaluationFunction<KNNK>::apply(const Position&) const {
|
Value EvaluationFunction<KNNK>::apply(const Position&) const {
|
||||||
return VALUE_ZERO;
|
return VALUE_DRAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// KBPKScalingFunction scales endgames where the stronger side has king,
|
/// KBPKScalingFunction scales endgames where the stronger side has king,
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Scale winning side if position is more drawish that what it appears
|
// Scale winning side if position is more drawish that what it appears
|
||||||
ScaleFactor sf = eg_value(bonus) > VALUE_ZERO ? mi->scale_factor(pos, WHITE)
|
ScaleFactor sf = eg_value(bonus) > VALUE_DRAW ? mi->scale_factor(pos, WHITE)
|
||||||
: mi->scale_factor(pos, BLACK);
|
: mi->scale_factor(pos, BLACK);
|
||||||
Phase phase = mi->game_phase();
|
Phase phase = mi->game_phase();
|
||||||
|
|
||||||
|
|||||||
@@ -994,7 +994,7 @@ namespace {
|
|||||||
|
|
||||||
// Step 2. Check for aborted search and immediate draw
|
// Step 2. Check for aborted search and immediate draw
|
||||||
if (AbortSearch || ThreadsMgr.thread_should_stop(threadID))
|
if (AbortSearch || ThreadsMgr.thread_should_stop(threadID))
|
||||||
return VALUE_ZERO;
|
return VALUE_DRAW;
|
||||||
|
|
||||||
if (pos.is_draw() || ply >= PLY_MAX - 1)
|
if (pos.is_draw() || ply >= PLY_MAX - 1)
|
||||||
return VALUE_DRAW;
|
return VALUE_DRAW;
|
||||||
|
|||||||
Reference in New Issue
Block a user