I tried my patch, and even a much simpler version for debug purposes:
Code: Select all
const int64_t SearchAgent::getTimeToSearch(const int64_t usedTime) {
if (getSearchMode()==SearchAgent::SEARCH_MOVETIME) {
return getMoveTime();
}
int64_t time = board.getSideToMove()==WHITE? getWhiteTime():getBlackTime();
int64_t incTime = board.getSideToMove()==WHITE?getWhiteIncrement():getBlackIncrement();
int64_t result = std::min(time-25, time/40 + incTime);
std::cout << "time allocated " << result << std::endl;
return result;
}
Code: Select all
position startpos moves e2e4
go wtime 1 winc 1 btime 1000 binc 1000
time allocated 975
...
info depth 15 score cp -36 time 1254 nodes 843776 nps 843776 pv e7e5 g1f3 b8c6 b1c3 f8c5 f1b5 a7a6 b5c6 d7c6
info nodes 843776 time 1254 nps 843776 hashfull 280
bestmove e7e5 ponder g1f3