ANTWORTKURVE FLOP: Linie am Flop (Vorflop-Aggressor), damit die Temperatur-Parameter am Flop gelten; Spec angepasst (nur_flop_turn_und_river)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
116fa9182a
commit
7d8b7638f1
@@ -109,3 +109,12 @@ fn ohne_raise_im_knoten_gibt_es_keine_raise_masse() {
|
||||
assert!((n.draws[0][0] - 0.75).abs() < 1e-12);
|
||||
assert_eq!(ohne_raise_normiert(z.clone(), &[Action::Fold, Action::Call, Action::Raise(900)]), z, "mit Raise unveraendert");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn linie_am_flop_hat_nur_den_vorflop_aggressor() {
|
||||
use crate::linie_merkmale::Linie;
|
||||
let h = serde_json::json!([{"street": "PREFLOP", "seat": 4, "action": "RAISE"}, {"street": "PREFLOP", "seat": 3, "action": "CALL"}]);
|
||||
let l = Linie::aus_verlauf(&h, 4, 3, 1).expect("Flop hat eine Linie");
|
||||
assert_eq!((l.wert(0), l.wert(1), l.wert(2), l.wert(3), l.wert(4), l.wert(5)), (1, 0, 0, 1, 0, 0), "Gegner war Vorflop-Aggressor, keine fruehere Strasse");
|
||||
assert!(Linie::aus_verlauf(&h, 4, 3, 0).is_none() && Linie::aus_verlauf(&h, 4, 3, 4).is_none());
|
||||
}
|
||||
|
||||
@@ -26,9 +26,10 @@ impl Linie {
|
||||
self.0[i]
|
||||
}
|
||||
|
||||
/// Aus `q.history` (Liste {street, seat, action}); `strasse` 2 Turn, 3 River. None fuer andere Strassen oder einen Verlauf, der keine Liste ist.
|
||||
/// Aus `q.history` (Liste {street, seat, action}); `strasse` 1 Flop (MOTOR_ANTWORTKURVE am Flop: nur der Vorflop-Aggressor, sonst keine fruehere Strasse), 2 Turn, 3 River.
|
||||
/// None fuer andere Strassen oder einen Verlauf, der keine Liste ist.
|
||||
pub fn aus_verlauf(verlauf: &Value, gegner: i64, held: i64, strasse: u8) -> Option<Linie> {
|
||||
if !(2..=3).contains(&strasse) {
|
||||
if !(1..=3).contains(&strasse) {
|
||||
return None;
|
||||
}
|
||||
let zuege = verlauf.as_array()?;
|
||||
@@ -41,7 +42,7 @@ impl Linie {
|
||||
};
|
||||
let vorher: Vec<i32> = (1..strasse as usize).map(|s| seite(setzer(STRASSEN[s]))).collect();
|
||||
let zahl = |w: i32| vorher.iter().filter(|&&x| x == w).count() as i32;
|
||||
let letzte = *vorher.last()?;
|
||||
let letzte = vorher.last().copied().unwrap_or(0); // Flop: keine fruehere Strasse
|
||||
Some(Linie([
|
||||
seite(setzer("PREFLOP")),
|
||||
zahl(1),
|
||||
@@ -111,8 +112,10 @@ mod spec {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nur_turn_und_river() {
|
||||
assert_eq!(Linie::aus_verlauf(&json!(blinds()), G, W, 1), None);
|
||||
fn nur_flop_turn_und_river() {
|
||||
// der Flop hat seit MOTOR_ANTWORTKURVE am Flop eine Linie (nur der Vorflop-Aggressor); davor und danach keine
|
||||
assert!(Linie::aus_verlauf(&json!(blinds()), G, W, 1).is_some());
|
||||
assert_eq!(Linie::aus_verlauf(&json!(blinds()), G, W, 0), None);
|
||||
assert_eq!(Linie::aus_verlauf(&json!(blinds()), G, W, 4), None);
|
||||
assert_eq!(Linie::aus_verlauf(&json!("kein Verlauf"), G, W, 2), None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user