Simplify use_time_management() and allow composing
authorNiklas Fiekas <niklas.fiekas@backscattering.de>
Wed, 24 Jun 2020 21:03:00 +0000 (23:03 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 27 Jun 2020 08:06:05 +0000 (10:06 +0200)
like other `go` commands wtime/btime can now be composed.

`go depth 10 wtime 100`

will let the engine use standard time management but stop if depth 10 is reached.

fixes https://github.com/official-stockfish/Stockfish/issues/2767

closes https://github.com/official-stockfish/Stockfish/pull/2768

No functional change

src/search.h

index 1653ce9237c0e46122a10a72439e08f370b01483..3e855c8bf34b82a53b46f64dc177404abe20ee85 100644 (file)
@@ -91,7 +91,7 @@ struct LimitsType {
   }
 
   bool use_time_management() const {
-    return !(mate | movetime | depth | nodes | perft | infinite);
+    return time[WHITE] || time[BLACK];
   }
 
   std::vector<Move> searchmoves;