Files
pokerfreak/messung/motor/stackoff_preis/linie_river.py
T
mmintelandClaude Opus 5.5 2a3fd72b65 Motor: Foldraten-Eichung der Stack-off-Tafel an echten CoinPoker-Gegnern (MOTOR_STACKOFF_EICHUNG); Stand 01.12. in Docs und README
River-Overbets ab 2,5x: echte Foldrate 50 ±12 % statt 75 % (hhDealer). Aus-Pruefung 17.033/17.033 gleich,
an 12/5.158 Nachflop-Raises geaendert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 10:57:49 +01:00

34 lines
2.2 KiB
Python

"""River-Jam-Foldrate nach der Linie davor (01.12., Befund AQo/A5s live): die Stack-off-Tafel J (nl2-stackoff.txt) mittelt die Foldrate
gegen bindende River-Einsaetze ueber alle Linien. Hier dieselben hhDealer-Spots (teile2, wie tafel.py: s=3, lvl 0, binding spr <= 0,5),
geteilt nach dem, was in derselben Hand (Board-Praefix, aufeinanderfolgende Zeilen) auf Turn und Flop geschah:
turn_bc Turn-Einsatz zu zweit, bezahlt turn_x kein Turn-Spot (durchgecheckt oder nicht zu zweit) turn_r Turn mit Raise
und zusaetzlich flop_bc (Flop-Einsatz bezahlt). Nur Zaehlungen, keine Hand-Ebene. Prioritaet BelowNormal, ein Prozess.
python -I -X utf8 linie_river.py <teile-ordner>"""
import collections, ctypes, glob, json, os, sys
try:
k = ctypes.windll.kernel32; k.GetCurrentProcess.restype = ctypes.c_void_p
k.SetPriorityClass.argtypes = [ctypes.c_void_p, ctypes.c_uint]; k.SetPriorityClass(k.GetCurrentProcess(), 0x4000)
except Exception:
pass
def fach(g): return 0 if g < 0.6 else 1 if g < 1.2 else 2 if g < 2.5 else 3
z = collections.defaultdict(lambda: [0, 0])
for d in sorted(glob.glob(os.path.join(sys.argv[1], "*.jsonl"))):
hand = []
for zl in open(d, encoding="utf-8"):
r = json.loads(zl)
b = r.get("b") or ""
if not hand or not b.startswith(hand[0].get("b") or "#") and not (hand[0].get("b") or "#").startswith(b[:6]):
hand = []
hand.append(r)
if r["s"] != 3 or r["lvl"] != 0 or r["spr"] > 0.5 or r["resp"] not in "fcr":
continue
turn = [x for x in hand[:-1] if x["s"] == 2]
flop = [x for x in hand[:-1] if x["s"] == 1]
tl = "turn_x" if not turn else "turn_r" if any(x["lvl"] >= 1 for x in turn) else "turn_bc" if any(x["resp"] == "c" for x in turn) else "turn_?"
fl = "flop_bc" if flop and any(x["resp"] == "c" and x["lvl"] == 0 for x in flop) and not any(x["lvl"] >= 1 for x in flop) else "flop_sonst"
for key in ((tl, "alle"), (tl, fl), ("alle", "alle")):
for f_ in (fach(r["g"]), 9):
z[(key, f_)][0] += r["resp"] == "f"; z[(key, f_)][1] += 1
for (key, f_), (fo, n) in sorted(z.items()):
if n >= 50: print(f"{key[0]:8s} {key[1]:10s} fach {f_}: n {n:6d} fold {fo / n:.3f}")