settle ai, reportevery, new katago for win

This commit is contained in:
Sander Land committed 2020-10-11 12:15:28 +02:00
1 parent 67e827b0ac
commit 2bf184694e
7 files changed
+47 -14

No files matched your search

+5 -1
View File
@@ -196,7 +196,8 @@ class KataGoEngine:
elif "warning" in analysis:
self.katrain.log(f"{analysis} received from KataGo", OUTPUT_DEBUG)
else:
del self.queries[query_id]
if not analysis.get("isDuringSearch", False):
del self.queries[query_id]
time_taken = time.time() - start_time
self.katrain.log(
f"[{time_taken:.1f}][{query_id}] KataGo Analysis Received: {analysis.keys()}", OUTPUT_DEBUG,
@@ -240,6 +241,7 @@ class KataGoEngine:
ownership: Optional[bool] = None,
next_move: Optional[GameNode] = None,
extra_settings: Optional[Dict] = None,
report_every: Optional[float] = None,
):
nodes = analysis_node.nodes_from_root
moves = [m for node in nodes for m in node.moves]
@@ -288,5 +290,7 @@ class KataGoEngine:
"moves": [[m.player, m.gtp()] for m in moves],
"overrideSettings": {**settings, **(extra_settings or {})},
}
if report_every is not None:
query["reportDuringSearchEvery"] = report_every
self.send_query(query, callback, error_callback, next_move)
analysis_node.analysis_visits_requested = max(analysis_node.analysis_visits_requested, visits)