Files
pokerfreak/tests/exploit_style.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

71 lines
1.7 KiB
Rust

use pokerfreak::exploit::profile::Profile;
use pokerfreak::exploit::style::{classify, Style};
fn profile(vpip: Option<f64>, pfr: Option<f64>, fold_to_bet: Option<f64>) -> Profile {
Profile {
vpip,
pfr,
fold_to_bet,
}
}
#[test]
fn nothing_known_is_unknown() {
assert_eq!(classify(&Profile::default()), Style::Unknown);
assert_eq!(
classify(&profile(Some(f64::NAN), None, Some(f64::NAN))),
Style::Unknown
);
}
#[test]
fn tight_players_are_nits() {
assert_eq!(classify(&profile(Some(0.10), Some(0.08), None)), Style::Nit);
assert_eq!(classify(&profile(None, None, Some(0.80))), Style::Nit);
}
#[test]
fn loose_and_raising_is_loose_aggressive() {
assert_eq!(
classify(&profile(Some(0.55), Some(0.35), None)),
Style::LooseAggressive
);
assert_eq!(
classify(&profile(Some(0.45), Some(0.30), Some(0.5))),
Style::LooseAggressive
);
}
#[test]
fn loose_and_passive_or_sticky_is_a_calling_station() {
assert_eq!(
classify(&profile(Some(0.50), Some(0.05), Some(0.2))),
Style::CallingStation
);
assert_eq!(
classify(&profile(Some(0.45), None, None)),
Style::CallingStation
);
assert_eq!(
classify(&profile(None, None, Some(0.15))),
Style::CallingStation
);
}
#[test]
fn ordinary_numbers_are_regular() {
assert_eq!(
classify(&profile(Some(0.22), Some(0.18), Some(0.5))),
Style::Regular
);
}
#[test]
fn out_of_range_values_are_clamped_not_trusted() {
assert_eq!(
classify(&profile(Some(7.0), Some(5.0), None)),
Style::LooseAggressive
);
assert_eq!(classify(&profile(Some(-3.0), None, None)), Style::Nit);
}