1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Simplify away some unneeded code in time management

The lower bound of the clamp is never used since complexity can't be negative and thus is unneeded.

closes https://github.com/official-stockfish/Stockfish/pull/4105

No functional change
This commit is contained in:
Michael Chaly 2022-07-13 11:59:54 +03:00 committed by Joost VandeVondele
parent 2e02dd7936
commit 95d24b77df

View file

@ -474,7 +474,7 @@ void Thread::search() {
double reduction = (1.56 + mainThread->previousTimeReduction) / (2.20 * timeReduction);
double bestMoveInstability = 1 + 1.7 * totBestMoveChanges / Threads.size();
int complexity = mainThread->complexityAverage.value();
double complexPosition = std::clamp(1.0 + (complexity - 277) / 1819.1, 0.5, 1.5);
double complexPosition = std::min(1.0 + (complexity - 277) / 1819.1, 1.5);
double totalTime = Time.optimum() * fallingEval * reduction * bestMoveInstability * complexPosition;