Files
pokerfreak/tests/exploit_style.rs
T
mmintelandClaude Opus 5.5 1ad6f76088 Bluffing and bluff catching driven by opponent frequencies
- exploit::fold_chance: documented foldToBet -> P(fold) map by bet size, per villain
- engine: two-branch EV for every raise (fold branch, called branch vs calling range)
- semibluffs first, pure bluffs heads-up above a fold and EV threshold
- betting ranges keep a bluff share (size, street, style or new profile.aggression)
- guards: no bluffs vs never-folders, no bluff catch vs ranges without bluffs
- steal width in unopened pots from how often the blinds fold
- combo-list sampling for narrow two-card ranges

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

72 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,
aggression: None,
}
}
#[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);
}