Skip to content

Commit

Permalink
Fix Move Overhead related issued
Browse files Browse the repository at this point in the history
bench 5022919
  • Loading branch information
rn5f107s2 committed Jun 24, 2024
1 parent d9b439f commit 8c3134d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/UCIOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void UCIOptions::setMoveOverhead(int val) {
void UCIOptions::init() {
spinOptions.push(UCIOptionSpin("Hash", 1, 1024, 16, &UCIOptions::setHash));
spinOptions.push(UCIOptionSpin("Threads", 1, 32, 1, &UCIOptions::setThreads));
spinOptions.push(UCIOptionSpin("Move Overhead", 0, 2000, 10, &UCIOptions::setMoveOverhead));
spinOptions.push(UCIOptionSpin("MoveOverhead", 0, 2000, 10, &UCIOptions::setMoveOverhead));
}

UCIOptionSpin *UCIOptions::findOptionSpin(const std::string& name) {
Expand Down
6 changes: 2 additions & 4 deletions src/timemanagement.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <chrono>
#include <array>

static int moveOverHead = 10;
extern int moveOverHead;

enum SearchLimit {
Time, Nodes, Depth
Expand All @@ -23,8 +23,6 @@ struct SearchTime{
void calcThinkingTime(int timeLeft, int increment, int movesToGo = 6000);
};

inline void setOverhead(int value) {
moveOverHead = value;
}
void setOverhead(int value);

#endif //MOLYBDENUM_TIMEMANAGEMENT_H
7 changes: 7 additions & 0 deletions src/timemanagment.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#include <algorithm>

#include "timemanagement.h"

int moveOverHead = 10;

void setOverhead(int val) {
moveOverHead = val;
}

void SearchTime::calcThinkingTime(int timeLeft, int increment, int movesToGo) {
int normalHardTime = std::min(int((timeLeft * 0.18) + (increment * 0.48)), timeLeft / 3);
int normalSoftTime = normalHardTime * 0.17;
Expand Down

0 comments on commit 8c3134d

Please sign in to comment.