mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Scale contempt factor to zero at endgame
Contempt Factor is more effective at opening/middle game and seems harmful at endgame phase. See: http://chessprogramming.wikispaces.com/Contempt+Factor http://web.archive.org/web/20070707023203/www.brucemo.com/compchess/programming/contempt.htm Therefore we scale down the contempt factor while going on with the game so to reach zero at endgame phase. No functional change.
This commit is contained in:
parent
aba152ea3a
commit
6c8663341e
1 changed files with 3 additions and 2 deletions
|
@ -175,8 +175,9 @@ void Search::think() {
|
||||||
Position& pos = RootPosition;
|
Position& pos = RootPosition;
|
||||||
Chess960 = pos.is_chess960();
|
Chess960 = pos.is_chess960();
|
||||||
Eval::RootColor = pos.side_to_move();
|
Eval::RootColor = pos.side_to_move();
|
||||||
Eval::ValueDraw[ Eval::RootColor] = VALUE_DRAW - Eval::ContemptFactor;
|
int scaledCF = Eval::ContemptFactor * MaterialTable::game_phase(pos) / PHASE_MIDGAME;
|
||||||
Eval::ValueDraw[~Eval::RootColor] = VALUE_DRAW + Eval::ContemptFactor;
|
Eval::ValueDraw[ Eval::RootColor] = VALUE_DRAW - Value(scaledCF);
|
||||||
|
Eval::ValueDraw[~Eval::RootColor] = VALUE_DRAW + Value(scaledCF);
|
||||||
TimeMgr.init(Limits, pos.startpos_ply_counter(), pos.side_to_move());
|
TimeMgr.init(Limits, pos.startpos_ply_counter(), pos.side_to_move());
|
||||||
TT.new_search();
|
TT.new_search();
|
||||||
H.clear();
|
H.clear();
|
||||||
|
|
Loading…
Add table
Reference in a new issue