Kandidat GEGEN_GROSS=0.2,river,ab:0.75,allin, aus = bitgleich. Holdout River: Jams +9886 bb [+5607, +14177], grosse Einsaetze ohne All-in +1317, Raises +44; eigene Haende +0,37 bb/100. Ohne allin verliert der Schalter an grossen Nicht-All-in-Einsaetzen (-11766). Nicht live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
2.0 KiB
Python
47 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Nachspiel der 34 Stack-off-Knoten (eigene Haende 15.-18.11., |netto| >= 40 bb, gegen Jam/Raise): Live-Stand 467becde
|
|
gegen Live + Kandidat. Eingaben ausserhalb des Repos (anfragen.jsonl, knoten.jsonl von der Stack-off-Nachspiel-Aufgabe).
|
|
|
|
python -I -X utf8 messung/stackoff/nachspiel34.py <stack-ordner> <kern_schalter-live.txt> <kern.exe> "K=V;K=V" <aus.jsonl>
|
|
"""
|
|
import json
|
|
import os
|
|
import shutil
|
|
import sys
|
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "lesen"))
|
|
import roentgen # noqa: E402
|
|
|
|
ordner, schalter, exe, arm, aus = sys.argv[1:6]
|
|
B = os.path.join(os.path.dirname(exe), "pokerbench-stackoff-nachspiel.exe")
|
|
shutil.copy2(exe, B)
|
|
kern = roentgen.kern_aufruf(B, timeout_je=60.0, prioritaet=roentgen.BELOW_NORMAL_PRIORITY_CLASS)
|
|
live = roentgen.lies_schalter(schalter)
|
|
kand = dict(live)
|
|
for kv in filter(None, arm.split(";")):
|
|
k, v = kv.split("=", 1)
|
|
kand[k] = v
|
|
K = [json.loads(z) for z in open(os.path.join(ordner, "knoten.jsonl"), encoding="utf-8")]
|
|
A = [json.loads(z) for z in open(os.path.join(ordner, "anfragen.jsonl"), encoding="utf-8")]
|
|
per = {}
|
|
for a in A:
|
|
per.setdefault(a["hand"], []).append(a["anfrage"])
|
|
anf = []
|
|
for k in K:
|
|
tr = [a for a in per[k["hand"]] if a["street"] == k["strasse"] and abs(a["toCall"] / a["bigBlind"] - k["tc_bb"]) < 0.06
|
|
and abs(a["pot"] / a["bigBlind"] - k["pot_bb"]) < 0.06]
|
|
anf.append(tr[0])
|
|
ol, ok = kern(anf, live), kern(anf, kand)
|
|
|
|
|
|
def zug(o):
|
|
d = o.get("decision") or o
|
|
return (d.get("action") or "?") + (f" {d['size']}" if d.get("size") else "")
|
|
|
|
|
|
with open(aus, "w", encoding="utf-8", newline="\n") as f:
|
|
for k, a, b in zip(K, ol, ok):
|
|
z = dict(strasse=k["strasse"], art=k["art"], karten=k["karten"], netto=k["netto"], live=zug(a), kandidat=zug(b))
|
|
f.write(json.dumps(z) + "\n")
|
|
print(z["strasse"], z["art"], z["karten"], z["netto"], z["live"], "->", z["kandidat"], "" if z["live"] == z["kandidat"] else " <== anders")
|