mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 09:47:46 +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:
committed by
Joost VandeVondele
parent
2e02dd7936
commit
95d24b77df
+1
-1
@@ -474,7 +474,7 @@ void Thread::search() {
|
|||||||
double reduction = (1.56 + mainThread->previousTimeReduction) / (2.20 * timeReduction);
|
double reduction = (1.56 + mainThread->previousTimeReduction) / (2.20 * timeReduction);
|
||||||
double bestMoveInstability = 1 + 1.7 * totBestMoveChanges / Threads.size();
|
double bestMoveInstability = 1 + 1.7 * totBestMoveChanges / Threads.size();
|
||||||
int complexity = mainThread->complexityAverage.value();
|
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;
|
double totalTime = Time.optimum() * fallingEval * reduction * bestMoveInstability * complexPosition;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user