ZEIGT_KIPP=richtung: gezeigte Haende kippen die Aggressiv-Linie nur staerker, die Passiv-Linie nur schwaecher (nie gegen einen Station-Read); =aggr/=passiv zur Diagnose; =1 und aus unveraendert. Leck-Finder: --zusatz und --gezeigt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 17:33:16 +01:00
co-authored by Claude Opus 5.5
parent ddf0ba02a9
commit 4f6e0ab0fd
6 changed files with 104 additions and 19 deletions
+38 -7
View File
@@ -74,19 +74,42 @@ pub fn range_spec(spot: &Spot, villain: &Villain) -> RangeSpec {
}
}
/// Messschalter (einmal gelesen) `ZEIGT_KIPP=1`: thin the villain's river range per preflop class toward
/// Messschalter (einmal gelesen) `ZEIGT_KIPP`: thin the villain's river range per preflop class toward
/// what he showed on his river line (`Profile::shown_river`). Off = no tilt, bit-identical.
pub fn shown_tilt_on() -> bool {
/// `1` both lines either way; `richtung` the aggressive line only stronger, the passive line only
/// weaker (shown hands never argue a checking/calling range stronger = never against a station read);
/// `aggr` / `passiv` one line only (diagnosis).
#[derive(Clone, Copy, PartialEq)]
enum TiltMode {
Off,
Both,
Direction,
AggrOnly,
PassiveOnly,
}
fn tilt_mode() -> TiltMode {
use std::sync::OnceLock;
static ON: OnceLock<bool> = OnceLock::new();
*ON.get_or_init(|| std::env::var("ZEIGT_KIPP").as_deref() == Ok("1"))
static MODE: OnceLock<TiltMode> = OnceLock::new();
*MODE.get_or_init(|| match std::env::var("ZEIGT_KIPP").as_deref() {
Ok("1") => TiltMode::Both,
Ok("richtung") => TiltMode::Direction,
Ok("aggr") => TiltMode::AggrOnly,
Ok("passiv") => TiltMode::PassiveOnly,
_ => TiltMode::Off,
})
}
pub fn shown_tilt_on() -> bool {
tilt_mode() != TiltMode::Off
}
/// The class target of the villain's range (`RangeSpec::class_target`): on the river, once he acted
/// there, the shown-hand distribution of his line (aggressive = he bet/raised the river, else passive).
fn shown_tilt(spot: &Spot, villain: &Villain) -> Option<[f64; super::range_spec::CLASSES]> {
fn shown_tilt(spot: &Spot, villain: &Villain) -> Option<super::range_spec::ClassTilt> {
use crate::game::SeenAction as A;
if !shown_tilt_on() || spot.street != crate::game::Street::River {
let mode = tilt_mode();
if mode == TiltMode::Off || spot.street != crate::game::Street::River {
return None;
}
let shown = villain.profile.as_ref()?.shown_river?;
@@ -96,5 +119,13 @@ fn shown_tilt(spot: &Spot, villain: &Villain) -> Option<[f64; super::range_spec:
acted = true;
aggr |= matches!(r.action, A::Bet | A::Raise | A::AllIn);
}
acted.then(|| shown[if aggr { 0 } else { 1 }])
if !acted || (mode == TiltMode::AggrOnly && !aggr) || (mode == TiltMode::PassiveOnly && aggr) {
return None;
}
let dir = match mode {
TiltMode::Direction if aggr => 1,
TiltMode::Direction => -1,
_ => 0,
};
Some(super::range_spec::ClassTilt { target: shown[if aggr { 0 } else { 1 }], dir })
}
+10 -1
View File
@@ -13,7 +13,16 @@ pub struct RangeSpec {
/// Shown-hand tilt (`ZEIGT_KIPP`, plan D3): the preflop-class distribution (`chen_class`, 0 premium
/// .. 4 weak) the hands of this range have in what the villain showed on this line. The range is
/// thinned per class toward it (`engine::range_filter`); `None` = no tilt (as before).
pub class_target: Option<[f64; CLASSES]>,
pub class_target: Option<ClassTilt>,
}
/// The shown-hand tilt of a range (`RangeSpec::class_target`): the class target, and the only direction
/// the tilt may move the range (`ZEIGT_KIPP=richtung`): `+1` only stronger (mean preflop class falls),
/// `-1` only weaker, `0` either way (`ZEIGT_KIPP=1`). A tilt the wrong way is not applied.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ClassTilt {
pub target: [f64; CLASSES],
pub dir: i8,
}
/// Preflop classes of `chen_class` (= `lesen/zeigt_eval.py` KLASSEN).