MOTOR_REIN_GEGEN: seltene Erhoehung gegen Einsatz auf Flop/Turn wird Fold/Call (echt -331 bb in 24 Haenden)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-29 23:27:23 +01:00
co-authored by Claude Opus 5.5
parent d062933495
commit 845298b5fb
3 changed files with 60 additions and 2 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ BEKANNTE_SCHALTER = ("FAUSTREGEL", "DROSSEL", "MDF_UNREAD", "RAISE_DRAWS", "RAIS
# Turniermotor (29.11., Standard aus): All-in des Baums bleibt All-in (entscheiden/turniermotor/src/dienst.rs allin_treu)
"TURNIER_ALLIN_TREU", "TURNIER_FLOP_ECHT", "TURNIER_FLOP_ECHT_FRIST",
# A/B an der Entscheidung (29.11., Standard aus): entscheiden/abspot.py, Auswertung lesen/ab_spot.py
"AB_SPOT", "AB_SPOT_B", "AB_SPOT_P", "AB_SPOT_SALZ", "AB_SPOT_FAEDEN", "AB_SPOT_EXE",
"AB_SPOT", "AB_SPOT_B", "AB_SPOT_P", "AB_SPOT_SALZ", "AB_SPOT_FAEDEN", "AB_SPOT_EXE", "MOTOR_REIN_GEGEN",
# Notbremse je Schalter (29.11., Standard aus): betrieb/notbremse_lauf.py, lesen/notbremse.py
"NOTBREMSE", "NOTBREMSE_MARKEN")
# Schalter des LAEUFERS (betrieb/runner.py liest sie aus seiner eigenen Umgebung, nicht der Kern): aus der
@@ -94,7 +94,7 @@ LAEUFER_SCHALTER = ("AUSWAHL_FREI", "TISCHWAHL", "TISCHWAHL_AB", "TISCHWAHL_WART
# Turniermotor (29.11., Standard aus): All-in des Baums bleibt All-in (entscheiden/turniermotor/src/dienst.rs allin_treu)
"TURNIER_ALLIN_TREU", "TURNIER_FLOP_ECHT", "TURNIER_FLOP_ECHT_FRIST",
# A/B an der Entscheidung (29.11., Standard aus): entscheiden/abspot.py, Auswertung lesen/ab_spot.py
"AB_SPOT", "AB_SPOT_B", "AB_SPOT_P", "AB_SPOT_SALZ", "AB_SPOT_FAEDEN", "AB_SPOT_EXE",
"AB_SPOT", "AB_SPOT_B", "AB_SPOT_P", "AB_SPOT_SALZ", "AB_SPOT_FAEDEN", "AB_SPOT_EXE", "MOTOR_REIN_GEGEN",
# Notbremse je Schalter (29.11., Standard aus): betrieb/notbremse_lauf.py, lesen/notbremse.py
"NOTBREMSE", "NOTBREMSE_MARKEN")
# Pfade gehoeren nicht in die Arm-Marke.
+37
View File
@@ -29,6 +29,7 @@ import json
import os
import queue
import random
import re
import subprocess
import sys
import threading
@@ -177,6 +178,41 @@ def gueltig(q, r):
return None
_REIN_ANTEIL = re.compile(r"(fold|call|check|all-in|[\d.]+x) (\d+)%")
_REIN_SCHWELLE = 25
def rein_gegen(q, r):
"""MOTOR_REIN_GEGEN=1 (29.11. 23:40, Standard aus): eine seltene Erhoehung gegen einen Einsatz auf Flop/Turn (Baum, nicht
"genau") wird nicht gespielt. Echtgeld 24.11.-29.11.: 24 Haende, in denen der Motor gegen Einsatz eine Erhoehung mit Anteil
< 25 % zog, -331 bb AIVAT (-13,8 bb je Hand; Flop 20 Haende -269, Turn 4 -62), z. B. AK/AQ Flop-All-in nach "fold 85 %".
Dieselben seltenen Erhoehungen OHNE Einsatz waren positiv (+232 bb, 94 Haende) und bleiben. Statt der Erhoehung spielt
der groessere der Anteile Fold/Call (Schwellen-Reinigung, Ganzfried/Sandholm 2012). Marke im Grund: REIN_GEGEN."""
try:
if os.environ.get("MOTOR_REIN_GEGEN") != "1" or not isinstance(r, dict):
return r
if q.get("street") not in ("FLOP", "TURN") or not (q.get("toCall") or 0) > 0:
return r
if str(r.get("action")) not in ("BET", "RAISE", "ALL_IN", "ALLIN"):
return r
g = str(r.get("reason") or "")
if not g.startswith("motor ") or "genau" in g or g.startswith("motor preis"):
return r
m = {k: int(v) for k, v in _REIN_ANTEIL.findall(g)}
if not m:
return r
hoch = sum(v for k, v in m.items() if k not in ("fold", "call", "check"))
if hoch >= _REIN_SCHWELLE:
return r
aktion = "CALL" if m.get("call", 0) > m.get("fold", 0) else "FOLD"
neu = dict(r, action=aktion, size=None,
reason=f"REIN_GEGEN: seltene Erhoehung {hoch} % gegen Einsatz -> {aktion}; {g}")
neu.pop("size", None)
return neu
except Exception:
return r
class Schatten:
def __init__(self, befehl, ziel=ZIEL, spielt=False):
self.befehl, self.ziel, self.spielt = befehl, ziel, spielt
@@ -445,6 +481,7 @@ class Schatten:
p.stdin.flush()
zeile = p.stdout.readline()
r = json.loads(zeile)
r = rein_gegen(q, r)
if vor is not None:
self._vor_scheibe(vor, r, time.time() - t1)
continue
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""MOTOR_REIN_GEGEN (29.11.): seltene Erhoehung gegen Einsatz auf Flop/Turn (Baum) wird Fold/Call. python3 tests/rein_gegen_spec.py"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "entscheiden"))
import schatten as S
Q = {"street": "FLOP", "toCall": 0.23}
R = {"action": "ALL_IN", "size": 5.0, "reason": "motor FLOP (2 im Topf, Klasse 1507): fold 85%, call 0%, all-in 15%"}
os.environ.pop("MOTOR_REIN_GEGEN", None)
assert S.rein_gegen(Q, R) is R # aus: unveraendert
os.environ["MOTOR_REIN_GEGEN"] = "1"
assert S.rein_gegen(Q, R)["action"] == "FOLD" and "size" not in S.rein_gegen(Q, R)
assert S.rein_gegen(Q, R)["reason"].startswith("REIN_GEGEN")
assert S.rein_gegen(Q, dict(R, reason="motor FLOP: fold 10%, call 75%, 0.80x 15%"))["action"] == "CALL"
assert S.rein_gegen(dict(Q, toCall=0), R)["action"] == "ALL_IN" # ohne Einsatz bleibt sie
assert S.rein_gegen(Q, dict(R, reason="motor TURN genau (800 ms): Fold 85%, AllIn 15%"))["action"] == "ALL_IN"
assert S.rein_gegen(Q, dict(R, reason="motor preis: x"))["action"] == "ALL_IN"
assert S.rein_gegen(Q, dict(R, reason="motor FLOP: fold 50%, call 0%, all-in 50%"))["action"] == "ALL_IN"
assert S.rein_gegen(dict(Q, street="RIVER"), R)["action"] == "ALL_IN"
print("rein_gegen_spec: gruen")