mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 03:26:24 +08: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
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user