From 2005e339ebaf88b7c3baa42f244ea38463885a50 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 10 Feb 2010 06:27:29 +0100 Subject: [PATCH] time_stop_conditions() TT_TOTAL: Clean up recommended_time setpu --- timeinfo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/timeinfo.c b/timeinfo.c index d63ff06..d86fa23 100644 --- a/timeinfo.c +++ b/timeinfo.c @@ -221,7 +221,7 @@ time_stop_conditions(struct time_info *ti, struct board *b, int fuseki_end, int /* We are in main time. */ assert(ti->len.t.main_time > 0); - max_time = recommended_time = ti->len.t.main_time; + max_time = ti->len.t.main_time; int moves_left = board_estimated_moves_left(b); /* If we have byoyomi available, plan to extend our thinking @@ -237,8 +237,10 @@ time_stop_conditions(struct time_info *ti, struct board *b, int fuseki_end, int max_time += (ti->len.t.byoyomi_periods - 2) * move_time; // Will add 1 more byoyomi_time just below } + + /* In case of Canadian byoyomi, condier move that can + * be spent on its first move. */ max_time += move_time; - recommended_time = max_time; /* Maximize the number of moves played uniformly in main time, while * not playing faster in main time than in byoyomi. At this point, @@ -257,7 +259,7 @@ time_stop_conditions(struct time_info *ti, struct board *b, int fuseki_end, int } /* Allocate even slice of the remaining time for next move. */ - recommended_time /= moves_left; + recommended_time = max_time / moves_left; assert(recommended_time > 0 && max_time > 0); assert(recommended_time <= max_time + 0.001); -- 2.11.4.GIT