stellarUCI Chess engine written in C++20 |
git clone git://git.dimitrijedobrota.com/stellar.git |
Log | Files | Refs | README | LICENSE | |
commit | f5a1612ce3e262c0265577a717159559649d157f |
parent | 0a46402c5b440a635a843d73708c8d39841ad245 |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Thu, 8 Feb 2024 20:08:59 +0000 |
Change time limit formula
Diffstat:M | src/engine/engine.cpp | | | ++++++-- |
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp
@@ -419,7 +419,8 @@ Move search_position(const uci::Settings &settingsr) {
rtable = repetition::Table();
Move lastBest;
uint64_t mid_point = settings->starttime + (settings->stoptime - settings->starttime) / 2;
uint64_t time_last = timer::get_ms();
uint8_t max_depth = settings->depth ? settings->depth : MAX_PLY;
for (uint8_t depth = 1; depth <= max_depth; depth++) {
lastBest = pvtable.best();
@@ -456,7 +457,10 @@ Move search_position(const uci::Settings &settingsr) {
std::cout << " pv " << pvtable << std::endl;
if (depth >= mate_ply) break;
if (!settings->depth && timer::get_ms() > mid_point) break;
uint64_t time_crnt = timer::get_ms();
if (!settings->depth && 2 * time_crnt - time_last > settings->stoptime) break;
time_last = time_crnt;
}
settings->board = board;