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>
35 lines
1.5 KiB
Python
35 lines
1.5 KiB
Python
"""Legt die Messkopie von b-inary an (D:/Projects/fremd/postflop-solver-mess): kleiner Gewichtsboden in play() + ein Lesezugriff."""
|
|
import os
|
|
import shutil
|
|
|
|
Q, Z = "D:/Projects/fremd/postflop-solver", "D:/Projects/fremd/postflop-solver-mess"
|
|
if os.path.isdir(Z):
|
|
shutil.rmtree(Z + "/src", ignore_errors=True)
|
|
os.makedirs(Z, exist_ok=True)
|
|
shutil.copytree(Q + "/src", Z + "/src")
|
|
for f in ("Cargo.toml", "LICENSE", "README.md"):
|
|
shutil.copy(Q + "/" + f, Z)
|
|
p = Z + "/src/game/interpreter.rs"
|
|
s = open(p, encoding="utf-8").read()
|
|
alt = """ let weights = row(&strategy, action, num_hands);
|
|
mul_slice(&mut self.weights[player], weights);"""
|
|
neu = """ // Messkopie: kleiner Boden, damit auch Haende abseits der Strategie einen EV haben
|
|
let weights: Vec<f32> = row(&strategy, action, num_hands).iter().map(|x| x.max(1e-6)).collect();
|
|
mul_slice(&mut self.weights[player], &weights);"""
|
|
assert alt in s
|
|
s = s.replace(alt, neu)
|
|
anker = " /// Returns whether the current node is a terminal node."
|
|
i = s.index(" pub fn is_terminal_node(&self)")
|
|
j = s.rfind("\n\n", 0, i) + 2
|
|
s = s[:j] + """ /// Messkopie: Betrag des letzten Einsatzes auf der laufenden Strasse (0 ohne Einsatz).
|
|
pub fn mess_letzter_betrag(&self) -> i32 {
|
|
match self.node().prev_action {
|
|
Action::Bet(a) | Action::Raise(a) | Action::AllIn(a) => a,
|
|
_ => 0,
|
|
}
|
|
}
|
|
|
|
""" + s[j:]
|
|
open(p, "w", encoding="utf-8", newline="").write(s)
|
|
print("ok")
|