count, cache

This commit is contained in:
Sander Land committed 2020-04-30 23:16:24 +02:00
1 parent 2dc47620a7
commit 4b08031c7f
10 files changed
+80 -24

No files matched your search

+2 -2
View File
@@ -71,9 +71,9 @@ def malkovich_analysis(cn):
if cn.analysis_ready and cn.parent and cn.parent.analysis_ready:
dscore = cn.analysis["root"]["scoreLead"] - cn.parent.analysis["root"]["scoreLead"]
logger.log(f"dscore {dscore} = {cn.analysis['root']['scoreLead']} {cn.parent.analysis['root']['scoreLead']} at {move}...", OUTPUT_ERROR)
if abs(dscore) > REPORT_SCORE_THRESHOLD:
if abs(dscore) > REPORT_SCORE_THRESHOLD and (cn.player == "B" and dscore < 0 or cn.player == "W" and dscore > 0): # relevant mistakes
favpl = "B" if dscore > 0 else "W"
msg = f"MALKOVICH:{cn.player} {cn.single_move.gtp()} caused a significant score change {favpl}{abs(dscore):+.1f} -> Winrate {cn.format_win_rate()} ScoreLead {cn.format_score()}"
msg = f"MALKOVICH:{cn.player} {cn.single_move.gtp()} caused a significant score change ({favpl} gained {abs(dscore):.1f} points) -> Win Rate {cn.format_win_rate()} Expected Score {cn.format_score()}"
if cn.ai_thoughts:
msg += f" AI Thoughts: {cn.ai_thoughts}"
print(msg, file=sys.stderr)