AB_SPOT_FLOP_TIEF: Flop-Anfragen an B in die zweite Bahn, Preflop allein in der ersten (Standard aus)

Loest Arm B den Flop live (2-5 s je Anfrage), stand Preflop in Bahn 0 hinter den Flop-Loesungen,
und der Laeufer wartete bis zur Frist von A. Mit AB_SPOT_FLOP_TIEF=1 geht der Flop in die Bahn
von Turn/River; ohne den Schalter bleibt die Zuordnung wie heute.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 15:23:13 +01:00
co-authored by Claude Fable 5.2
parent 57437a809f
commit 904176e079
4 changed files with 37 additions and 6 deletions
+4 -2
View File
@@ -16,6 +16,7 @@ Schalter (betrieb/kern_schalter.txt, Laeufer-Schalter):
AB_SPOT_P=0.5 Anteil B an den Unterschiedspunkten
AB_SPOT_SALZ=<Text> Salz der Muenze (Vorgabe: der Name); ein neues Salz = neue Zuteilung
AB_SPOT_VERFALL=1 Anfrage an B, deren Frist schon vorbei ist, geht nicht mehr an den Motor (Zeile "verfallen", Standard aus)
AB_SPOT_FLOP_TIEF=1 Flop-Anfragen an B in die zweite B-Bahn (Turn/River), Preflop bleibt allein in der ersten (Standard aus)
AB_SPOT_FAEDEN=8 Rechenfaeden je B-Prozess (unter den Spiel-Motoren, Prioritaet ueber normal)
AB_SPOT_EXE=<Pfad> eigene Motor-Exe fuer Arm B (29.11.: SHARINGAN liegt nur in der Exe vom 29.11.; A bleibt die
live bewiesene Exe). Gleiche Argumente wie A; fehlt die Datei, bleibt B aus (alles A).
@@ -32,7 +33,7 @@ KURZ = ("action", "size", "confidence", "reason")
def konfig(umgebung=None):
"""None = aus. Sonst {name, b (Umgebung des Arms B), p, salz, faeden, exe, verfall}."""
"""None = aus. Sonst {name, b (Umgebung des Arms B), p, salz, faeden, exe, verfall, flop_tief}."""
u = os.environ if umgebung is None else umgebung
name = (u.get("AB_SPOT") or "").strip()
if not name:
@@ -57,7 +58,8 @@ def konfig(umgebung=None):
if exe and not os.path.isfile(exe):
return None
return {"name": name, "b": b, "p": p, "salz": u.get("AB_SPOT_SALZ") or name, "faeden": faeden, "exe": exe,
"verfall": (u.get("AB_SPOT_VERFALL") or "").strip() == "1"}
"verfall": (u.get("AB_SPOT_VERFALL") or "").strip() == "1",
"flop_tief": (u.get("AB_SPOT_FLOP_TIEF") or "").strip() == "1"}
def muenze(salz, raum, hand):
+2 -2
View File
@@ -73,7 +73,7 @@ BEKANNTE_SCHALTER = ("FAUSTREGEL", "DROSSEL", "MDF_UNREAD", "RAISE_DRAWS", "RAIS
"TURNIER_ALLIN_TREU", "TURNIER_FLOP_ECHT", "TURNIER_FLOP_ECHT_FRIST", "TURNIER_KERN",
"TURNIER_SUCHE_QUELLE", "TURNIER_SUCHE_ADRESSE", "TURNIER_SUCHE_EXE",
# 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_VERFALL", "AB_SPOT_EXE", "MOTOR_REIN_GEGEN", "SCHWACHJAM_SPERRE",
"AB_SPOT", "AB_SPOT_B", "AB_SPOT_P", "AB_SPOT_SALZ", "AB_SPOT_FAEDEN", "AB_SPOT_VERFALL", "AB_SPOT_FLOP_TIEF", "AB_SPOT_EXE", "MOTOR_REIN_GEGEN", "SCHWACHJAM_SPERRE",
# Notbremse je Schalter (29.11., Standard aus): betrieb/notbremse_lauf.py, lesen/notbremse.py
"NOTBREMSE", "NOTBREMSE_MARKEN",
# Turnierergebnisse nachholen (30.11., Standard AN, =0 aus): betrieb/turnier_nachholen.py im Laeufer
@@ -109,7 +109,7 @@ LAEUFER_SCHALTER = ("AUSWAHL_FREI", "RUECKKEHR_STACK", "LEER_HOECHST", "NEUSTART
"TURNIER_ALLIN_TREU", "TURNIER_FLOP_ECHT", "TURNIER_FLOP_ECHT_FRIST", "TURNIER_KERN",
"TURNIER_SUCHE_QUELLE", "TURNIER_SUCHE_ADRESSE", "TURNIER_SUCHE_EXE",
# 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_VERFALL", "AB_SPOT_EXE", "MOTOR_REIN_GEGEN", "SCHWACHJAM_SPERRE",
"AB_SPOT", "AB_SPOT_B", "AB_SPOT_P", "AB_SPOT_SALZ", "AB_SPOT_FAEDEN", "AB_SPOT_VERFALL", "AB_SPOT_FLOP_TIEF", "AB_SPOT_EXE", "MOTOR_REIN_GEGEN", "SCHWACHJAM_SPERRE",
# Notbremse je Schalter (29.11., Standard aus): betrieb/notbremse_lauf.py, lesen/notbremse.py
"NOTBREMSE", "NOTBREMSE_MARKEN",
# Turnierergebnisse nachholen (30.11., Standard AN, =0 aus): betrieb/turnier_nachholen.py im Laeufer
+2 -1
View File
@@ -354,7 +354,8 @@ class Schatten:
"""Denselben Zug mit demselben Seed in die B-Bahn (Turn/River in die zweite). Ist sie voll, spielt A (nicht gezogen)."""
z["seed"] = random.getrandbits(62)
zb = {"da": threading.Event(), "ab": False, "bis": z["bis"], "seed": z["seed"]}
bahn = self.b_bahnen[1] if q.get("street") in ("TURN", "RIVER") else self.b_bahnen[0]
tief = ("TURN", "RIVER", "FLOP") if self.ab.get("flop_tief") else ("TURN", "RIVER") # AB_SPOT_FLOP_TIEF: der Flop loest live, Preflop wartet nicht dahinter
bahn = self.b_bahnen[1] if q.get("street") in tief else self.b_bahnen[0]
try:
bahn.put_nowait((time.time(), q, None, str(raum), str(hand), zb))
except queue.Full:
+29 -1
View File
@@ -1,7 +1,7 @@
"""AB_SPOT (29.11.): A/B an der Entscheidung - Muenze, Unterschied, B-Prozess mit eigener Umgebung, gleicher Seed, Frist, Log.
Ersatz-Motor (kein echter Motor, keine Tische): River antwortet er FOLD, mit ERSATZ_B=1 CALL; im Grund steht der Seed.
ERSATZ_LANGSAM=1 rechnet 3 s (B kommt zu spaet). Aus (kein AB_SPOT): kein B-Prozess, kein Feld `ab`."""
import json, os, sys, tempfile, threading, time
import json, os, queue, sys, tempfile, threading, time
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "entscheiden"))
import abspot as A
@@ -159,4 +159,32 @@ for verfall in ("0", "1"):
r = m.zug(frage(), raum="r", hand="z", frist=5)
assert r["action"] in ("FOLD", "CALL") and r["ab"]["art"] in ("spot", "gleich"), r
aufraeumen()
# --- AB_SPOT_FLOP_TIEF: der Flop in die zweite B-Bahn, Preflop allein in der ersten ---------------------------------------------
aufraeumen()
assert A.konfig({"AB_SPOT": "X"})["flop_tief"] is False # Vorgabe aus
assert A.konfig({"AB_SPOT": "X", "AB_SPOT_FLOP_TIEF": "0"})["flop_tief"] is False
assert A.konfig({"AB_SPOT": "X", "AB_SPOT_FLOP_TIEF": "1"})["flop_tief"] is True
def bahn_von(tief, strasse):
"""In welche B-Bahn (0/1) geht eine Anfrage der Strasse? Leere Ersatz-Bahnen, damit kein Arbeiter sie leert."""
aufraeumen()
os.environ.update({"AB_SPOT": "ERSATZ_B", "AB_SPOT_B": "ERSATZ_B=1"})
if tief:
os.environ["AB_SPOT_FLOP_TIEF"] = "1"
m = S.Schatten([sys.executable, ersatz], ziel=os.path.join(d, "tief.jsonl"), spielt=True)
m.b_bahnen = (queue.Queue(1), queue.Queue(1))
zb = m._b_anstossen(json.loads(frage(strasse)), "r", "h", {"bis": time.time() + 5, "seed": 1})
return [i for i in (0, 1) if m.b_bahnen[i].qsize() == 1], zb
for tief, soll in ((False, {"PREFLOP": 0, "FLOP": 0, "TURN": 1, "RIVER": 1}), (True, {"PREFLOP": 0, "FLOP": 1, "TURN": 1, "RIVER": 1})):
for strasse, bahn in soll.items():
assert bahn_von(tief, strasse)[0] == [bahn], (tief, strasse)
m = S.Schatten([sys.executable, ersatz], ziel=os.path.join(d, "tief.jsonl"), spielt=True) # B-Bahn voll: wie heute
m.b_bahnen = (queue.Queue(1), queue.Queue(1))
m._b_anstossen(json.loads(frage("FLOP")), "r", "h", {"bis": time.time() + 5, "seed": 1})
zb = m._b_anstossen(json.loads(frage("FLOP")), "r", "h", {"bis": time.time() + 5, "seed": 1})
assert zb["grund"] == "B-Bahn voll" and zb["da"].is_set()
aufraeumen()
print("ab_spot_spec: gruen")