Compare commits

..
+9 -4
View File
@@ -133,7 +133,9 @@ pub(crate) fn uebersetze_allin(z: &Zustand, m: &Menue, x: f32, echt_allin: bool,
if !ohne.is_empty() {
let mut v: Vec<(f32, Zug)> = ohne.iter().map(|y| (anteil(z, y.ziel), *y)).collect();
v.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap());
return Some(abbilden(&v, x, rng));
let (y, gut) = abbilden(&v, x, rng);
let spanne = erhoehungen.iter().filter(|y| ist_allin_zug(z, y)).map(|y| anteil(z, y.ziel)).fold(f32::NEG_INFINITY, f32::max);
return Some((y, gut || x < spanne));
}
}
uebersetze(z, m, x, rng)
@@ -162,7 +164,7 @@ fn abbilden(v: &[(f32, Zug)], x: f32, rng: &mut Rng) -> (Zug, bool) {
}
}
let l = v[v.len() - 1];
(l.1, l.1.code == ALLIN || x <= l.0 * 1.8 + 0.2)
(l.1, l.1.code == ALLIN || ((1.0 + x as f64) / (1.0 + l.0 as f64)) < 1.0 + crate::konstanten::GROESSEN_GLEICH)
}
/// Als Erster im Topf (kein Limper, kein Raise, nicht SB/BB) nie nur mitgehen: der Anteil geht auf die Erhoehungen.
@@ -943,10 +945,13 @@ impl Motor {
let hoch = mein + offen;
let a = anteil(&z, zug.ziel) as f64;
let (min, max) = (f("minRaiseTo").unwrap_or(0.0), f("maxRaiseTo").unwrap_or(f64::MAX));
let mut ziel = (hoch + a * (pot + offen)).clamp(min.min(max), max);
if crate::allin_probe::ist_allin(ziel, max, mein, hoch, pot) {
let mut ziel = hoch + a * (pot + offen);
let a_allin = (max - hoch) / (pot + offen);
// All-in nur, wenn es echt nicht viel groesser ist als im Baum; fast alles = alles
if (zug.code == ALLIN && a_allin <= a * 1.4) || ziel - mein > 0.8 * (max - mein) {
ziel = max;
}
let ziel = ziel.clamp(min.min(max), max);
jam = ziel >= max;
("RAISE", Some((ziel / bb * 100.0).round() / 100.0 * bb))
}