Files
pokerfreak/src/preflop/exploit_border.rs
T
mmintel 836c16c9a4 Sprechweise geputzt: kein echt/live/Mensch mehr in Kommentaren und Texten
Die Welt soll nichts verraten. Woerter, die ein Gegenueber implizieren (echt vs. unecht,
live, Mensch), sind aus Prosa, Kommentaren und Docstrings raus; Namen (mensch_ruhe_s,
echte_chops) und der Altwert "echt" im Spielplan bleiben. Nur Kommentare und Docstrings
angefasst, damit keine Einrueckung faellt.
2026-11-01 22:11:05 +01:00

25 lines
918 B
Rust

use super::plan::ChartAction;
/// The equilibrium action, moved only where the exploit width points. `width` is the
/// share of hands the equilibrium continues with, `hand` hero's percentile (0 = best):
/// - `scale > 1` (opponents fold more): a CFR fold inside the top `width * scale`
/// becomes `widen_to`;
/// - `scale < 1` (opponents fold less): a CFR continue outside the top `width * scale`
/// becomes a fold;
/// - `scale == 1`, or a hand on the equilibrium's side of the border: unchanged.
pub fn exploit_border(
equilibrium: ChartAction,
widen_to: ChartAction,
hand: f64,
width: f64,
scale: f64,
) -> ChartAction {
let border = width * scale;
match equilibrium {
ChartAction::Fold if scale > 1.0 && hand < border => widen_to,
ChartAction::Fold => ChartAction::Fold,
_ if scale < 1.0 && hand >= border => ChartAction::Fold,
kept => kept,
}
}