Vorflop jam probe: delete the old pool value ev_b (jam value is the best-answer value ev_a)
Deleted: the (b) pool block in dienst.rs vorflop_jam_wert (temperatur::dosis mix, j_zelle/k_zelle lookup, 'Pool ... (gecallt ...%)' reason text), vorflop_jamprobe::ev_pool and ::wert, the einsatzstaerke table of vorflop_tafel.rs (VorTafel, Klassen, Antwort, tafel(), reading of MOTOR_VORFLOP_ALLIN_TAFEL / MOTOR_STAPEL_PREIS_VORFLOP_TAFEL / MOTOR_STAPEL_PREIS_TAFEL; nothing else used the table once vorflop_allin.rs was gone), the unused Lage struct and the limps counter. The jam value is now ev_a. Deleted tests: vorflop_jamprobe.rs pool_wert_aus_quote_und_gewinnchance, wert_ohne_ausbeute_ist_die_rechnung_mit_dosis_gemischt. Behaviour change by design: with a table configured the old mix changed the verdict; under the live line (no table) nothing changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
98bcbf207b
commit
1d80525d3b
@@ -1474,8 +1474,7 @@ impl Motor {
|
||||
|
||||
/// MOTOR_VORFLOP_JAMPROBE: Wert unseres gezogenen Vorflop-All-ins gegen Fold (vorflop_jamprobe.rs) und der Text fuer den Zuggrund (ohne
|
||||
/// schliessende Klammer). (a) Rechnung: Gegner-Ranges am Knoten aus der Tafel (ohne Spielerlinie), jeder Gegner mit der Bestantwort auf
|
||||
/// unsere Jam-Range (Tafel-Range des Helden mal Anteil der Jam-Zuege je Klasse). (b) Pool nur mit MOTOR_TEMPERATUR und geladener
|
||||
/// Einsatzstaerke-Tafel. None, wenn die Lage nicht rechenbar ist (Sitz ohne echten Stack, leere Range).
|
||||
/// unsere Jam-Range (Tafel-Range des Helden mal Anteil der Jam-Zuege je Klasse). None, wenn die Lage nicht rechenbar ist (Sitz ohne echten Stack, leere Range).
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn vorflop_jam_wert(&self, q: &Value, l: &Lage, gegner: &[usize], sitze: &[i64], versatz: usize, ich: u8, hand: (u8, u8), menue: &Menue, jams: &[usize], salz: u64) -> Option<(f64, String, bool)> {
|
||||
use crate::vorflop_jamprobe::{self as jp, RakeModell, Sitz, Tisch};
|
||||
@@ -1484,21 +1483,19 @@ impl Motor {
|
||||
// echte Einsaetze dieser Hand je Sitz (hoechster Betrag vorflop)
|
||||
let mut drin: HashMap<i64, f64> = HashMap::new();
|
||||
let mut raises: Vec<i64> = Vec::new();
|
||||
let (mut hoch, mut limps) = (0.0f64, 0u32);
|
||||
let mut hoch = 0.0f64;
|
||||
for h in q["history"].as_array()?.iter().filter(|h| h["street"] == "PREFLOP") {
|
||||
let (Some(sitz), Some(akt)) = (h["seat"].as_i64(), h["action"].as_str()) else { continue };
|
||||
let betrag = h["amount"].as_f64().unwrap_or(0.0);
|
||||
let e = drin.entry(sitz).or_insert(0.0);
|
||||
*e = e.max(betrag);
|
||||
// wie vorflop_tafel.rs `verlauf`: ein All-in unter dem Einsatz ist ein Call
|
||||
// ein All-in unter dem Einsatz ist ein Call
|
||||
match akt {
|
||||
"POST_SB" | "POST_BB" => hoch = hoch.max(betrag),
|
||||
"CALL" if raises.is_empty() => limps += 1,
|
||||
"RAISE" | "BET" | "ALL_IN" if betrag > hoch + 1e-9 => {
|
||||
raises.push(sitz);
|
||||
hoch = betrag;
|
||||
}
|
||||
"RAISE" | "BET" | "ALL_IN" if raises.is_empty() => limps += 1,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
@@ -1561,31 +1558,8 @@ impl Motor {
|
||||
ja / alle.max(1e-30)
|
||||
})
|
||||
.fold(0.0, f64::max);
|
||||
// (b) Pool: nur mit dem Ausbeute-Schalter (Dosis der Temperatur) und geladener Einsatzstaerke-Tafel
|
||||
let mut ev_b = None;
|
||||
let dosis = crate::temperatur::dosis();
|
||||
if let (Some(_), Some(t)) = (dosis, crate::vorflop_tafel::tafel()) {
|
||||
let stufe = (raises.len() + 1).min(4) as u8;
|
||||
let iso = (stufe == 1 && limps > 0) as u8;
|
||||
// Caller fuer die Betraege: der letzte Raiser, sonst der tiefste lebende Gegner
|
||||
let j = raises.last().and_then(|r| seats.iter().position(|s| s == r)).unwrap_or_else(|| {
|
||||
(0..tisch.gegner.len()).max_by(|a, b| tisch.gedeckt(*a).partial_cmp(&tisch.gedeckt(*b)).unwrap()).unwrap()
|
||||
});
|
||||
let eff_bb = tisch.gedeckt(j) / bb;
|
||||
let band = crate::vorflop_tafel::band_von(eff_bb);
|
||||
let idx = sitze.iter().position(|&x| x == held)?;
|
||||
let pos = if idx <= 1 { 1 } else if sitze.len() >= 3 && idx + 2 >= sitze.len() { 2 } else { 3 };
|
||||
let lage = crate::vorflop_tafel::Lage { stufe, iso, band, pos, typ: 0, anteil: 1.0, allin: true, zu: 0.0, pot: 0.0, bb, mein_drin, sein_drin: 0.0, eff: eff_bb * bb, sitz_gegner: seats[j] };
|
||||
if let (Some(jz), Some(kz)) = (t.j_zelle(&lage), t.k_zelle(stufe, band, 0, 0)) {
|
||||
if let Some(eq) = crate::vorflop_tafel::gewinnchance_klassen(hand, &kz.w, crate::vorflop_tafel::VERSUCHE) {
|
||||
ev_b = Some((jp::ev_pool(eq as f64, jz.quote as f64, &tisch, j, &rake), jz.quote));
|
||||
}
|
||||
}
|
||||
}
|
||||
let w = jp::wert(ev_a, ev_b.map(|x| x.0), dosis);
|
||||
let b_text = ev_b.map_or(String::new(), |(e, qu)| format!(", Pool {:+.1} bb (gecallt {:.0}%)", e / bb, qu * 100.0));
|
||||
// MOTOR_JAMPROBE_POOL: das Urteil der Probe (Wert < 0) kippt nur mit Beleg aus dem Poolmodell (vorflop_jamprobe_pool.rs)
|
||||
let mut streicht = w < 0.0;
|
||||
let mut streicht = ev_a < 0.0;
|
||||
let mut pool_text = String::new();
|
||||
if crate::vorflop_jamprobe_pool::an() {
|
||||
// fehlt die Tafel-Antwort ganz, beginnt die Hierarchie beim Pool: neutraler Wurzel-Prior (Rufanteil 1/2, alle Klassen gleich), nie die Bestantwort
|
||||
@@ -1598,12 +1572,12 @@ impl Motor {
|
||||
let neu = crate::vorflop_jamprobe_pool::jam_streichen(streicht, &g);
|
||||
pool_text = format!(", Pool {:+.1} bb [{:+.1}; {:+.1}] (Prior Tafel-Antwort, ruft bis {:.0}%, ohne Tafel {:.0}%; {})", g.mittel / bb, g.unten / bb, g.oben / bb, tafel_ruf * 100.0, tafel_ohne * 100.0, if neu == streicht { "kein Beleg gegen das heutige Urteil" } else if neu { "Jam nicht belegt" } else { "Jam belegt" });
|
||||
// MOTOR_ALLIN_PROBE: auch die Bestantwort-Rechnung (Wert w) muss tragen, nicht nur das Poolmodell (Leitplanke gegen den perfekten Gegner)
|
||||
streicht = neu || (crate::allin_probe::an() && w <= 0.0);
|
||||
streicht = neu || (crate::allin_probe::an() && ev_a <= 0.0);
|
||||
}
|
||||
Err(e) => pool_text = format!(", Pool nicht gerechnet: {e}"),
|
||||
}
|
||||
}
|
||||
Some((w, format!(" [Vorflop-Jam-Probe: Rechnung {:+.1} bb (Bestantwort, ruft mit bis {:.0}% der Range){b_text}, Wert {:+.1} bb{pool_text}", ev_a / bb, quote_ruf * 100.0, w / bb), streicht))
|
||||
Some((ev_a, format!(" [Vorflop-Jam-Probe: Rechnung {:+.1} bb (Bestantwort, ruft mit bis {:.0}% der Range), Wert {:+.1} bb{pool_text}", ev_a / bb, quote_ruf * 100.0, ev_a / bb), streicht))
|
||||
}
|
||||
|
||||
/// Tafel-Antwort der Gegner auf unseren Jam (Gleichgewichts-Naeherung, Wurzel-Prior des Poolmodells): je Gegner `gegner[j]` der Rufanteil seiner Range
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
//! Range nicht verliert. Seine Hand kommt aus seiner Range am Knoten (Tafel, wie `ranges_mit`, ohne Spielerlinie). Unser Wert ist exakt
|
||||
//! mehrweg: alle Caller zugleich, Seitentoepfe nach den echten Stacks, Rake nach dem Modell; Stichprobe mit fester Saat.
|
||||
//! Naeherung: jeder Gegner entscheidet, als waere er allein gegen uns (spaetere Overcalls kennt er nicht).
|
||||
//! (b) Pool (Ausbeute, nur mit dem Ausbeute-Schalter MOTOR_TEMPERATUR): Call-Quote und Caller-Range eines All-ins dieser Stufe aus der
|
||||
//! Einsatzstaerke-Tafel (Zeilen J/K, `vorflop_tafel.rs`), ein Caller. Wert gemischt mit der Dosis d der Temperatur: (1-d) a + d b.
|
||||
use crate::karten::{alle_paare, vorflop, Rng, HAENDE};
|
||||
use crate::wert::{bit, score};
|
||||
|
||||
@@ -205,28 +203,6 @@ pub fn ev_jam(hand: (u8, u8), t: &Tisch, ranges: &[Vec<f32>], ruft: &dyn Fn(usiz
|
||||
(n > 0).then(|| summe / n as f64)
|
||||
}
|
||||
|
||||
/// Wert gegen den Pool: Gegner j callt mit Quote `p_call`, sonst folden alle; `eq` unsere Gewinnchance gegen seine Call-Range.
|
||||
pub fn ev_pool(eq: f64, p_call: f64, t: &Tisch, j: usize, rake: &RakeModell) -> f64 {
|
||||
let mut b = beitraege(t, &vec![false; t.gegner.len()]);
|
||||
b.push(t.tot);
|
||||
let fold = t.topf() - rake.geld(&b, false);
|
||||
let mut callt = vec![false; t.gegner.len()];
|
||||
callt[j] = true;
|
||||
let mut b = beitraege(t, &callt);
|
||||
b.push(t.tot);
|
||||
let endtopf: f64 = b.iter().sum();
|
||||
let call = eq * (endtopf - rake.geld(&b, true)) - (t.gedeckt(j) - t.mein_drin);
|
||||
(1.0 - p_call) * fold + p_call * call
|
||||
}
|
||||
|
||||
/// Entscheidender Wert: ohne Ausbeute die Rechnung, mit Ausbeute-Dosis d gemischt.
|
||||
pub fn wert(ev_a: f64, ev_b: Option<f64>, dosis: Option<f32>) -> f64 {
|
||||
match (ev_b, dosis) {
|
||||
(Some(b), Some(d)) => (1.0 - d as f64) * ev_a + d as f64 * b,
|
||||
_ => ev_a,
|
||||
}
|
||||
}
|
||||
|
||||
/// Gewinnchance je Vorflop-Klasse (eine Vertreterhand) gegen eine Verteilung ueber die 169 Klassen.
|
||||
pub fn klassen_gegen(w: &[f32; crate::vorflop_tafel::KLASSEN], versuche: u32) -> Vec<Option<f32>> {
|
||||
let paare = alle_paare();
|
||||
@@ -319,23 +295,6 @@ mod spec {
|
||||
assert!((-72.0..-60.0).contains(&ev), "{ev}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pool_wert_aus_quote_und_gewinnchance() {
|
||||
let t = zu_zweit(2.0);
|
||||
assert!((ev_pool(0.5, 0.0, &t, 0, &OHNE) - 3.0).abs() < 1e-9);
|
||||
// gecallt: 0,5 x 200 - 99 = 1
|
||||
assert!((ev_pool(0.5, 1.0, &t, 0, &OHNE) - 1.0).abs() < 1e-9);
|
||||
assert!((ev_pool(0.5, 0.5, &t, 0, &OHNE) - 2.0).abs() < 1e-9);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wert_ohne_ausbeute_ist_die_rechnung_mit_dosis_gemischt() {
|
||||
assert_eq!(wert(-4.0, Some(6.0), None), -4.0);
|
||||
assert_eq!(wert(-4.0, None, Some(1.0)), -4.0);
|
||||
assert_eq!(wert(-4.0, Some(6.0), Some(1.0)), 6.0);
|
||||
assert_eq!(wert(-4.0, Some(6.0), Some(0.5)), 1.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rake_regel_ohne_flop_auf_den_gematchten_topf() {
|
||||
let r = RakeModell::Regel { regel: crate::rake::regel(0.02).unwrap(), spieler: 6 };
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
//! Vorflop-Schieb-Reichweiten des Pools (einsatzstaerke v3, Zeilen J/K/R): Tafel, Gewinnchance gegen eine Klassenverteilung, Band- und
|
||||
//! Typ-Einteilung und die Lage-Felder. Teilauszug aus `vorflop_preis.rs` der alles-Linie (claude/vorflop-allin 02a93f0f). Benutzt von
|
||||
//! `vorflop_jamprobe.rs`, `vorflop_jamprobe_pool.rs` und der Vorflop-Probe in `dienst.rs`.
|
||||
//! Handklassen des Vorflop-Pools: Gewinnchance einer Hand gegen eine Verteilung ueber die 169 Klassen, Band- und Typ-Einteilung.
|
||||
//! Teilauszug aus `vorflop_preis.rs` der alles-Linie (claude/vorflop-allin 02a93f0f). Benutzt von `vorflop_jamprobe.rs`,
|
||||
//! `vorflop_jamprobe_pool.rs` und der Vorflop-Probe in `dienst.rs`.
|
||||
use crate::karten::{paar, vorflop, vorflop_kombos, Rng};
|
||||
use crate::wert::{bit, score};
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
pub const KLASSEN: usize = 169;
|
||||
/// Grenzen des wirksamen Stacks in bb; Index 1..7, 0 = alle.
|
||||
pub const BAND_GRENZEN: [f64; 6] = [12.0, 20.0, 35.0, 60.0, 100.0, 150.0];
|
||||
/// Grenzen Raise / wirksamer Stack fuer Zeile R; Index 1..5 (5 = All-in), 0 = alle.
|
||||
pub const ANTEIL_GRENZEN: [f64; 4] = [0.15, 0.30, 0.50, 0.80];
|
||||
|
||||
/// Stichproben der Gewinnchance-Rechnung (feste Saat; Standardfehler unter 0,2 Punkten).
|
||||
pub const VERSUCHE: u32 = 120_000;
|
||||
pub const MIN_N_R: f64 = 30.0;
|
||||
|
||||
/// Zellen mit weniger gezeigten Haenden gelten nicht (aus stapel_preis.rs der alles-Linie).
|
||||
pub const MIN_N_GEZEIGT: f64 = 50.0;
|
||||
pub const VPIP_ENG: f64 = 0.30;
|
||||
pub const VPIP_LOCKER: f64 = 0.44;
|
||||
pub const MIN_HAENDE_TYP: f64 = 100.0;
|
||||
@@ -39,117 +30,6 @@ pub fn typ_von(profile: &Value) -> u8 {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- Tafel
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Klassen {
|
||||
/// Zeile J: Zahl der All-ins der Zelle; Zeile K: Zahl der Calls
|
||||
pub n_ereignisse: f64,
|
||||
/// J: Anteil, der gecallt wurde
|
||||
pub quote: f32,
|
||||
pub n_gezeigt: f64,
|
||||
pub w: [f32; KLASSEN],
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub struct Antwort {
|
||||
pub n: f64,
|
||||
pub fold: f32,
|
||||
pub call: f32,
|
||||
pub raise: f32,
|
||||
}
|
||||
|
||||
/// Schluessel J: (Stufe, iso, Stack-Band, Position, Typ); K: (Stufe, 0, Band, Position, Typ); R: (Stufe, Anteil-Band, Band, Typ, 0).
|
||||
type Schl = (u8, u8, u8, u8, u8);
|
||||
|
||||
#[derive(Debug, Clone, Default, PartialEq)]
|
||||
pub struct VorTafel {
|
||||
pub j: HashMap<Schl, Klassen>,
|
||||
pub k: HashMap<Schl, Klassen>,
|
||||
pub r: HashMap<Schl, Antwort>,
|
||||
}
|
||||
|
||||
fn zahl<T: std::str::FromStr>(w: &[&str], i: usize) -> Option<T> {
|
||||
w.get(i)?.parse().ok()
|
||||
}
|
||||
|
||||
fn verteilung(w: &[&str], ab: usize) -> Option<[f32; KLASSEN]> {
|
||||
if w.len() != ab + KLASSEN {
|
||||
return None;
|
||||
}
|
||||
let mut x = [0f32; KLASSEN];
|
||||
for (i, v) in x.iter_mut().enumerate() {
|
||||
*v = w[ab + i].parse::<f32>().ok().filter(|f| f.is_finite())?.max(0.0);
|
||||
}
|
||||
(x.iter().sum::<f32>() > 0.0).then_some(x)
|
||||
}
|
||||
|
||||
impl VorTafel {
|
||||
/// Kaputte und fremde Zeilen (S, A, Kommentare) werden uebergangen; ohne eine gueltige J/K/R-Zeile: None.
|
||||
pub fn lies(text: &str) -> Option<VorTafel> {
|
||||
let mut t = VorTafel::default();
|
||||
for z in text.lines() {
|
||||
let w: Vec<&str> = z.split('#').next().unwrap_or("").split_whitespace().collect();
|
||||
match w.first().copied() {
|
||||
Some("J") => {
|
||||
// J L iso band pos typ n_jams callquote n_gezeigt w0..w168
|
||||
let (Some(l), Some(iso), Some(b), Some(p), Some(ty), Some(nj), Some(cq), Some(ng), Some(x)) =
|
||||
(zahl::<u8>(&w, 1), zahl::<u8>(&w, 2), zahl::<u8>(&w, 3), zahl::<u8>(&w, 4), zahl::<u8>(&w, 5), zahl::<f64>(&w, 6), zahl::<f32>(&w, 7), zahl::<f64>(&w, 8), verteilung(&w, 9))
|
||||
else { continue };
|
||||
t.j.insert((l, iso, b, p, ty), Klassen { n_ereignisse: nj, quote: cq.clamp(0.0, 1.0), n_gezeigt: ng, w: x });
|
||||
}
|
||||
Some("K") => {
|
||||
// K L band pos typ n 0 n_gezeigt w0..w168
|
||||
let (Some(l), Some(b), Some(p), Some(ty), Some(n), Some(ng), Some(x)) =
|
||||
(zahl::<u8>(&w, 1), zahl::<u8>(&w, 2), zahl::<u8>(&w, 3), zahl::<u8>(&w, 4), zahl::<f64>(&w, 5), zahl::<f64>(&w, 7), verteilung(&w, 8))
|
||||
else { continue };
|
||||
t.k.insert((l, 0, b, p, ty), Klassen { n_ereignisse: n, quote: 0.0, n_gezeigt: ng, w: x });
|
||||
}
|
||||
Some("R") => {
|
||||
// R L anteil band typ n fold call raise
|
||||
let (Some(l), Some(a), Some(b), Some(ty), Some(n), Some(f), Some(c), Some(r)) =
|
||||
(zahl::<u8>(&w, 1), zahl::<u8>(&w, 2), zahl::<u8>(&w, 3), zahl::<u8>(&w, 4), zahl::<f64>(&w, 5), zahl::<f32>(&w, 6), zahl::<f32>(&w, 7), zahl::<f32>(&w, 8))
|
||||
else { continue };
|
||||
if w.len() == 9 && [f, c, r].iter().all(|x| x.is_finite() && *x >= 0.0) {
|
||||
t.r.insert((l, a, b, ty, 0), Antwort { n, fold: f, call: c, raise: r });
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
(!t.j.is_empty() || !t.k.is_empty() || !t.r.is_empty()).then_some(t)
|
||||
}
|
||||
|
||||
/// Reichweite des All-ins; Rueckfall Typ -> Position -> Stack-Band (je auf 0), nur mit genug gezeigten Haenden.
|
||||
pub fn j_zelle(&self, l: &Lage) -> Option<&Klassen> {
|
||||
let (a, b, c) = (l.band, l.pos, l.typ);
|
||||
[(a, b, c), (a, b, 0), (a, 0, 0), (0, 0, 0)]
|
||||
.iter()
|
||||
.find_map(|&(ba, po, ty)| self.j.get(&(l.stufe, l.iso, ba, po, ty)).filter(|z| z.n_gezeigt >= MIN_N_GEZEIGT))
|
||||
}
|
||||
|
||||
/// Reichweite der Caller eines All-ins der Stufe `stufe`; gleicher Rueckfall.
|
||||
pub fn k_zelle(&self, stufe: u8, band: u8, pos: u8, typ: u8) -> Option<&Klassen> {
|
||||
[(band, pos, typ), (band, pos, 0), (band, 0, 0), (0, 0, 0)]
|
||||
.iter()
|
||||
.find_map(|&(ba, po, ty)| self.k.get(&(stufe, 0, ba, po, ty)).filter(|z| z.n_gezeigt >= MIN_N_GEZEIGT))
|
||||
}
|
||||
|
||||
/// Antwort des Vor-Raisers; Rueckfall Typ -> Band (je auf 0).
|
||||
pub fn r_zelle(&self, stufe: u8, anteil: u8, band: u8, typ: u8) -> Option<&Antwort> {
|
||||
[(band, typ), (band, 0), (0, typ), (0, 0)].iter().find_map(|&(ba, ty)| self.r.get(&(stufe, anteil, ba, ty, 0)).filter(|z| z.n >= MIN_N_R))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tafel() -> Option<&'static VorTafel> {
|
||||
static T: OnceLock<Option<VorTafel>> = OnceLock::new();
|
||||
T.get_or_init(|| {
|
||||
let pfad = std::env::var("MOTOR_VORFLOP_ALLIN_TAFEL").ok().or_else(|| std::env::var("MOTOR_STAPEL_PREIS_VORFLOP_TAFEL").ok()).or_else(|| std::env::var("MOTOR_STAPEL_PREIS_TAFEL").ok())?;
|
||||
VorTafel::lies(&std::fs::read_to_string(pfad).ok()?)
|
||||
})
|
||||
.as_ref()
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- Gewinnchance gegen eine Klassenverteilung
|
||||
|
||||
/// Gewinnchance (Sieg + halbe Teilung) einer konkreten Hand gegen eine Verteilung ueber die 169 Handklassen, Stichprobe mit fester Saat.
|
||||
@@ -201,32 +81,6 @@ pub fn gewinnchance_klassen(hand: (u8, u8), w: &[f32; KLASSEN], versuche: u32) -
|
||||
Some((gew / versuche as f64) as f32)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- Lage aus der Anfrage
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct Lage {
|
||||
/// Stufe des letzten Raises: 1 Open, 2 3-Bet, 3 4-Bet, 4 = 5-Bet und mehr
|
||||
pub stufe: u8,
|
||||
/// Open nach mindestens einem Limper
|
||||
pub iso: u8,
|
||||
/// Band des wirksamen Stacks (1..7)
|
||||
pub band: u8,
|
||||
/// Position des Raisers: 1 Blinds, 2 Button/Cutoff, 3 frueh, 0 unbekannt
|
||||
pub pos: u8,
|
||||
pub typ: u8,
|
||||
/// Raise-Ziel / wirksamer Stack, All-in
|
||||
pub anteil: f64,
|
||||
pub allin: bool,
|
||||
pub zu: f64,
|
||||
pub pot: f64,
|
||||
pub bb: f64,
|
||||
/// Geld: unser Einsatz bisher, sein Einsatz bisher, wirksamer Stack (beide Gesamtbetraege)
|
||||
pub mein_drin: f64,
|
||||
pub sein_drin: f64,
|
||||
pub eff: f64,
|
||||
pub sitz_gegner: i64,
|
||||
}
|
||||
|
||||
pub fn band_von(eff_bb: f64) -> u8 {
|
||||
BAND_GRENZEN.iter().position(|g| eff_bb <= *g).map_or(7, |i| i as u8 + 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user