Files
pokerfreak/messung/motor/echtgeld/muster.py
T
mmintelandClaude Opus 5.5 c75a2b1863 Motor: Rust-Engine mit NL2-Regeln und Spielertypen, Pruefwerkzeuge
Regeln fuer River, Flop/Turn, Einsaetze und Iso gegen Limper (nl2.rs), Tafeln ohne Spielerkennungen.
Gemeinsam gegen den Trainer-Pool: +8,0 +-3,9 bb/100 mit bekanntem Typ, +0,9 +-6,6 ohne. Gewinn live nicht belegt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:51:18 +01:00

48 lines
3.1 KiB
Python

# Was brachte jeder Zug wirklich? Wert ab der Entscheidung gegen Fold = netto + vorher eingezahlt (bb), ohne Modell.
import json,collections,math,sys
L=".claude/worktrees/engine-lecks-angreifen-de7b88/archiv/lauf/"
H={}
for z in open(L+"haende.jsonl",encoding="utf-8"):
r=json.loads(z)
if r["bb"]==.02 and r["spielart"]=="NLHE" and not (r.get("splash") and 0) and r["zeit"][:10]>="2026-11-14" : H[r["hand"]]=r
Z=collections.defaultdict(list)
for z in open(L+"zuege.jsonl",encoding="utf-8"):
r=json.loads(z)
if r["hand"] in H: Z[r["hand"]].append(r)
RF="23456789TJQKA"
def kl(h):
a,b=sorted(h,key=lambda c:-RF.index(c[0])); return a[0]+b[0]+("" if a[0]==b[0] else "s" if a[1]==b[1] else "o")
K=collections.defaultdict(list); G=[]
for h,zs in Z.items():
net=H[h]["netto"]/.02; fest=0; st=None; lv=0; ag=False; seen=[]
for x in zs:
if x["street"]!=st:
if seen and x["street"]=="PREFLOP": break
fest+=lv; lv=0; st=x["street"]; ag=False; seen.append(st)
tc=x["toCall"]/.02; a=(x["aktion"] or "").upper(); g=(x.get("groesse") or 0)/.02
inv=fest+lv; wert=net+inv; pot=x["pot"]/.02
z=a if a in("FOLD","CHECK","CALL") else "RAISE"
if st=="PREFLOP":
if z=="CALL" and tc>=15: K["V1 preflop CALL >=15bb"].append((wert,h)); G.append((wert,tc,pot,kl(x["hole"]),h,x["grund"][:60]))
elif z=="CALL" and ag: K["V2 preflop CALL nach eigener Erhoehung, <15bb"].append((wert,h))
elif z=="RAISE" and g>=25: K["V3 preflop RAISE auf >=25bb"].append((wert,h))
elif z=="RAISE" and ag: K["V4 preflop 2. Erhoehung <25bb"].append((wert,h))
else:
rel=tc/max(pot-tc,.1)
if z=="CALL" and ag: K[st+" CALL gegen Raise auf unseren Einsatz"].append((wert,h))
elif z=="CALL": K[st+" CALL gegen Einsatz "+("<=60%" if rel<=.6 else ">60%")].append((wert,h))
elif z=="RAISE" and tc>0: K[st+" RAISE gegen Einsatz"].append((wert,h))
elif z=="RAISE": K[st+" Einsatz "+("<50%" if g<.5*pot else "<=110%" if g<=1.1*pot else ">110%")].append((wert-pot,h))
if z=="RAISE": lv=g; ag=True
elif z=="CALL": lv+=tc
elif z=="CHECK": pass
N=len(H); print(N,"Haende")
for k,v in sorted(K.items()):
w=[a for a,_ in v]; n=len(w); m=sum(w)/n; s=math.sqrt(sum((y-m)**2 for y in w)/max(n-1,1)/n)
print("%-46s n %4d je Zug %+6.2f +-%.2f bb gesamt %+6.1f +-%.1f bb/100"%(k,n,m,s,sum(w)/N*100,s*n/N*100))
print("(Einsatz: Wert minus Topf, d.h. gegen 'Topf sofort gewonnen'; Calls/Raises: gegen Fold)")
c=collections.defaultdict(list)
for g in G: c["Paar TT-" if g[3][0]==g[3][1] and g[3][0] in "23456789T" else "Paar JJ+" if g[3][0]==g[3][1] else "AK" if g[3][:2]=="AK" else "AQ" if g[3][:2]=="AQ" else "Ax klein" if g[3][0]=="A" else "Rest"].append(g[0])
for k,v in c.items(): print(k,len(v),"Mittel %.1f Summe %.0f bb"%(sum(v)/len(v),sum(v)))
for g in sorted(G)[:200]: print("%6.1f call %5.1f Topf %5.1f %-4s %s %s"%g[:4] if 0 else "%6.1f call %5.1f Topf %5.1f %-4s noetig %.0f%% %s | %s"%(g[0],g[1],g[2],g[3],100*g[1]/(g[1]+g[2]),g[4],g[5])) if len(sys.argv)>1 else None