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>
50 lines
2.0 KiB
Python
50 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Eigene Kern-Anfragen (Turn/River mit zu zahlendem Einsatz) der Haende aus eigen.jsonl aus archiv/rohlog und
|
|
archiv/mitschrieb, ohne Namen/Kennungen. Ausgabe ausserhalb des Repos.
|
|
|
|
python -I -X utf8 messung/stackoff/eigen_ziehen.py <eigen.jsonl> <aus.jsonl>
|
|
"""
|
|
import glob
|
|
import gzip
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
_hier = os.path.dirname(os.path.abspath(__file__))
|
|
_w = os.path.join(_hier, "..", "..")
|
|
sys.path.insert(0, os.path.join(_w, "lesen"))
|
|
import spot_from_log as sfl # noqa: E402
|
|
|
|
E = {json.loads(z)["hand"]: json.loads(z) for z in open(sys.argv[1], encoding="utf-8")}
|
|
dateien = []
|
|
for o in ("D:/Projects/pokerfreak/archiv/rohlog", "D:/Projects/pokerfreak/archiv/mitschrieb"):
|
|
dateien += glob.glob(os.path.join(o, "*.log*"))
|
|
gesehen, n = set(), 0
|
|
with open(sys.argv[2], "w", encoding="utf-8", newline="\n") as f:
|
|
for p in sorted(dateien, key=os.path.getmtime):
|
|
op = gzip.open if p.endswith(".gz") else open
|
|
try:
|
|
text = op(p, "rt", encoding="utf-8", errors="replace").read()
|
|
except (OSError, EOFError):
|
|
continue
|
|
for zeile, _, _, hand, _ in sfl.spots(text):
|
|
if str(hand) not in E:
|
|
continue
|
|
try:
|
|
a = json.loads(zeile)
|
|
except ValueError:
|
|
continue
|
|
if not a.get("legalActions") or a.get("street") not in ("TURN", "RIVER") or not (a.get("toCall") or 0) > 0:
|
|
continue
|
|
k = (str(hand), a.get("street"), len(a.get("history") or ()), a.get("toCall"), json.dumps(a.get("board")))
|
|
if k in gesehen:
|
|
continue
|
|
gesehen.add(k)
|
|
a.pop("_sitze", None)
|
|
for v in a.get("villains") or ():
|
|
v.pop("kennung", None)
|
|
v.pop("name", None)
|
|
f.write(json.dumps({"hand": str(hand), "anfrage": a}) + "\n")
|
|
n += 1
|
|
print("anfragen", n, "haende", len({k[0] for k in gesehen}), "von", len(E))
|