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, } }