Solver-Kern Stufe 4: SOLVER3_MS, SOLVER3_ROHNE, Begründung der Multiway-Solver mit solver-kern; ALLIN_EINSATZ (Eröffnungs-All-in als Einsatz)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 15:47:09 +01:00
co-authored by Claude Opus 5.5
parent df1ed68da6
commit 12d3c671f7
10 changed files with 59 additions and 9 deletions
+23 -2
View File
@@ -72,6 +72,26 @@ fn level(action: SeenAction) -> Option<usize> {
}
}
/// `level` of the record at `i`. Under `ALLIN_EINSATZ=1` an ALL_IN is a raise only after an earlier
/// bet or raise on its street; opening the street it is a bet (its size is read like any bet). Off (default,
/// bit-identical): every ALL_IN is a raise. Live 19.11. (hand 180802100046): a river donk all-in of 0,29 pot
/// got the bet curve AND the river raise floor, AcKd on Ks (top pair) had equity 0,00 and folded.
fn level_in(history: &[ActionRecord], i: usize, action: SeenAction) -> Option<usize> {
if action == SeenAction::AllIn && allin_einsatz() {
let street = history[i].street;
let after_aggression = history[..i].iter().any(|r| r.street == street && r.action.is_aggressive());
return Some(usize::from(after_aggression));
}
level(action)
}
/// Messschalter `ALLIN_EINSATZ=1` (einmal gelesen), see `level_in`.
pub fn allin_einsatz() -> bool {
use std::sync::OnceLock;
static AN: OnceLock<bool> = OnceLock::new();
*AN.get_or_init(|| std::env::var("ALLIN_EINSATZ").as_deref() == Ok("1"))
}
/// The strongest aggression of the villain on `street`: highest level, then biggest ratio.
fn own_aggression(
history: &[ActionRecord],
@@ -82,8 +102,9 @@ fn own_aggression(
history
.iter()
.zip(ratios)
.filter(|(r, _)| r.street == street && r.seat == seat)
.filter_map(|(r, ratio)| level(r.action).map(|l| (l, *ratio)))
.enumerate()
.filter(|(_, (r, _))| r.street == street && r.seat == seat)
.filter_map(|(i, (r, ratio))| level_in(history, i, r.action).map(|l| (l, *ratio)))
.max_by(|a, b| {
a.0.cmp(&b.0).then(
a.1.unwrap_or(-1.0)