Ticket #33 (closed enhancement: fixed)
Unify level adaption systems in clock.c and play_gtp.c
| Reported by: | arend | Owned by: | arend |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7.8 |
| Component: | source | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | patch: | yes |
Description (last modified by arend) (diff)
Currently we have two level adaption schemese:
* In clock.c, triggered by --autolevel
* In play_gtp.c, triggered by time_left GTP commands.
This patch unifies them. While it reuses some of the clock measurement code of clock.c, for the actual level adaption system it uses the logic of the code of play_gtp.c, which (while somewhat simplistic) has been tested in some thousands of KGS games.
With the new code, clock.c automatically tracks time usage for both colors (triggered by clock_push_button() in gnugo_genmove()). This timing data can be overwritten by calls to update_time_left() (e.g. called upon the GTP command time_left). However, the interface explicitly has to call adjust_level_offset() for this to have any effect.
The variables level, min_level, max_level and level_offset are now privat variables of clock.c, accessible via set_level() etc. level_offset is not accessible directly, it is set by adjust_level_offset(); however, get_level() always returns level + level_offset.
Attachments
Regression Results
| Attachment | Rev. | PASS | FAIL | Nodes | Status | |
| arend_7_8.1-clock.diff | never tested | |||||
| arend_7_8.1b-clock.diff | never tested | |||||
| arend_7_8.1c.diff | never tested |

