Replace UCT/montecarlo games=N parameter with -t =N main zzgo parameter
[pachi.git] / timeinfo.h
blob5633397ebaf92a8aad0aa2dc3ac8e7babc1a39f6
1 #ifndef ZZGO_TIMEINFO_H
2 #define ZZGO_TIMEINFO_H
4 /* Time-keeping information about time to spend on the next move and/or
5 * rest of the game. */
7 /* Note that some ways of specifying time (TD_GAMES) may not make sense
8 * with all engines. */
10 #include <stdbool.h>
11 #include <time.h>
13 struct time_info {
14 /* For how long we can spend the time? */
15 enum time_period {
16 TT_NULL, // No time limit. Other structure elements are undef.
17 TT_MOVE, // Time for the next move.
18 TT_TOTAL, // Time for the rest of the game.
19 } period;
20 /* How are we counting the time? */
21 enum time_dimension {
22 TD_GAMES, // Fixed number of simulations to perform.
23 TD_WALLTIME, // Wall time to spend performing simulations.
24 } dim;
25 union {
26 int games; // TD_GAMES
27 struct timespec walltime; // TD_WALLTIME
28 } len;
31 /* Parse time information provided in custom format:
32 * =NUM - fixed number of simulations per move
33 * NUM - number of seconds to spend per move
34 * _NUM - number of seconds to spend per game
36 * Returns false on parse error. */
37 bool time_parse(struct time_info *ti, char *s);
39 #endif