diff --git a/src/wire/decode_villain.rs b/src/wire/decode_villain.rs index bba5c7e4..2f534b72 100644 --- a/src/wire/decode_villain.rs +++ b/src/wire/decode_villain.rs @@ -43,7 +43,9 @@ fn profile(villain: &Value, path: &str) -> Result, Fault> { flop_aggression: None, fold_to_steal: None, fold_to_raise: None, - raise_to_bet: None, + // Raise frequency facing a postflop bet (`RERAISE_TIEFE` gate): a forced read for measurement + // (`LBR_PROFIL`); live it comes counted through `reads.raiseToBet` below. Absent: None. + raise_to_bet: opt_number_member(object, &at_profile, "raiseToBet")?, }; // `hands` (extension, exploit::sample): with it, few hands count little let shrunk = match opt_number_member(object, &at_profile, "hands")? { @@ -117,6 +119,9 @@ const THREE_BET_ANCHOR: f64 = 0.07; const STEAL_ANCHOR: f64 = 0.35; const FOLD_TO_STEAL_ANCHOR: f64 = 0.65; const FOLD_TO_RAISE_ANCHOR: f64 = 0.45; +/// Anchor and strength of the counted raise-facing-a-bet read (= `sim::memory`). +const RAISE_TO_BET_ANCHOR: f64 = 0.30; +const RAISE_TO_BET_PRIOR: f64 = 10.0; /// `reads` (extension, the memory handover `lesen/uebergabe.py`, switch GEGNER_GEDAECHTNIS): counted /// reads with their true sample replace the HUD/shrunk rates, one posterior per read; the confidences @@ -184,6 +189,12 @@ fn with_reads(object: &Value, path: &str, p: Profile) -> Result if let Some(r) = get("foldToRaise")? { out.fold_to_raise = r.posterior(Some(FOLD_TO_RAISE_ANCHOR), LINE_PRIOR); } + // Raises facing a postflop bet over folds + calls + raises facing one (lesen/zaehler.py raiseToBet): + // shrunk toward RAISE_TO_BET_ANCHOR with RAISE_TO_BET_PRIOR pseudo-samples, exactly as the sim + // memory (`sim::memory`), so ladder and live read the same number. Only `RERAISE_TIEFE` uses it. + if let Some(r) = get("raiseToBet")? { + out.raise_to_bet = r.posterior(Some(RAISE_TO_BET_ANCHOR), RAISE_TO_BET_PRIOR); + } // Shown river bets: raw share and count (the river gearbox blends them by their own count). if let Some(r) = get("riverBluffShown")? { if out.river_bluff_shown.is_none() { diff --git a/tests/wire_decode.rs b/tests/wire_decode.rs index 447ea9b5..30aee291 100644 --- a/tests/wire_decode.rs +++ b/tests/wire_decode.rs @@ -367,3 +367,18 @@ fn memory_reads_become_posteriors() { assert!((p.aggression_confidence.unwrap() - 60.0 / 90.0).abs() < 1e-12); assert!((p.confidence.unwrap() - 443.0 / 473.0).abs() < 1e-12); } + +/// The raise-facing-bet read (`raiseToBet`, RERAISE_TIEFE): absent = None (live bit-identical while the +/// switch is off), a counted read becomes a posterior on the anchor 0.30 with strength 10, a direct +/// top-level rate is taken as given (forced read, LBR_PROFIL). +#[test] +fn raise_to_bet_read() { + let hud = r#""villains":[{"seat":1,"stack":50,"folded":false,"profile":{"vpip":0.3,"foldToBet":0.6,"hands":24}}]"#; + assert_eq!(run(&plus(hud)).unwrap().villains[0].profile.unwrap().raise_to_bet, None); + let counted = r#""villains":[{"seat":1,"stack":50,"folded":false,"profile":{"vpip":0.3,"foldToBet":0.6,"hands":24, + "reads":{"raiseToBet":{"n":40,"k":4}}}}]"#; + let p = run(&plus(counted)).unwrap().villains[0].profile.unwrap(); + assert!((p.raise_to_bet.unwrap() - (4.0 + 3.0) / 50.0).abs() < 1e-12); + let direct = r#""villains":[{"seat":1,"stack":50,"folded":false,"profile":{"vpip":0.3,"foldToBet":0.6,"hands":24,"raiseToBet":0.15}}]"#; + assert!((run(&plus(direct)).unwrap().villains[0].profile.unwrap().raise_to_bet.unwrap() - 0.15).abs() < 1e-12); +}