Files
pokerfreak/src/preflop/certainty.rs
T
mmintelandClaude Opus 5.5 ec800a1672 Preflop charts and exploitation layer
Hand percentiles (169-class equity ranking, Omaha-5 structural score with
empirical CDF), position/situation inference, position x situation charts,
all-in-or-fold charts, pot-odds all-in calls, advise(); exploit style
classification, threshold adjustment and villain range guess.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:00:21 +01:00

13 lines
524 B
Rust

//! How firmly a chart holds for one hand.
/// Distance from `percentile` to the nearest cut-off that actually separates hands
/// (`0 < c < 1`), measured against `max(0.3 * c, 0.01)` and clamped to `[0, 1]`.
/// 1.0 deep inside or outside every range, near 0 right at a border.
pub fn certainty(percentile: f64, cutoffs: &[f64]) -> f64 {
cutoffs
.iter()
.filter(|c| **c > 0.0 && **c < 1.0)
.map(|c| ((percentile - c).abs() / (0.3 * c).max(0.01)).clamp(0.0, 1.0))
.fold(1.0, f64::min)
}