Stichprobe je Gegner und reads: der Kern vertraut duennen Werten weniger und sagt, wie er sieht
Opponent stats come without a hand count, so 70 % VPIP over two hands counted like a long record, and nobody could see how the engine read a player. Optional profile.hands pulls frequencies toward the population (w = hands / (hands + 30)); without it nothing changes. The response gains `reads` (seat, style, foldChance, trust) next to the contract keys; VERTRAG.md is untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+29
-28
@@ -1,28 +1,29 @@
|
||||
//! Exploitation layer: reads opponent profiles, moves thresholds and range guesses.
|
||||
|
||||
pub mod adjust;
|
||||
pub mod band_bounds;
|
||||
pub mod band_stretch;
|
||||
pub mod bet_ratio;
|
||||
pub mod bluff_share;
|
||||
pub mod call_floor;
|
||||
pub mod fold_chance;
|
||||
pub mod fold_equity_scale;
|
||||
pub mod made_ladder;
|
||||
pub mod pot_trace;
|
||||
pub mod preflop_role;
|
||||
pub mod profile;
|
||||
pub mod range_guess;
|
||||
pub mod range_model;
|
||||
pub mod range_spec;
|
||||
pub mod range_narrowing;
|
||||
pub mod role_band;
|
||||
pub mod role_from_history;
|
||||
pub mod size_notch;
|
||||
pub mod street_continuation;
|
||||
pub mod steal_width;
|
||||
pub mod style;
|
||||
pub mod style_rung;
|
||||
pub mod style_shift;
|
||||
pub mod table_fold;
|
||||
pub mod thresholds;
|
||||
//! Exploitation layer: reads opponent profiles, moves thresholds and range guesses.
|
||||
|
||||
pub mod adjust;
|
||||
pub mod band_bounds;
|
||||
pub mod band_stretch;
|
||||
pub mod bet_ratio;
|
||||
pub mod bluff_share;
|
||||
pub mod call_floor;
|
||||
pub mod fold_chance;
|
||||
pub mod fold_equity_scale;
|
||||
pub mod made_ladder;
|
||||
pub mod pot_trace;
|
||||
pub mod preflop_role;
|
||||
pub mod profile;
|
||||
pub mod range_guess;
|
||||
pub mod range_model;
|
||||
pub mod range_spec;
|
||||
pub mod range_narrowing;
|
||||
pub mod role_band;
|
||||
pub mod role_from_history;
|
||||
pub mod sample;
|
||||
pub mod size_notch;
|
||||
pub mod street_continuation;
|
||||
pub mod steal_width;
|
||||
pub mod style;
|
||||
pub mod style_rung;
|
||||
pub mod style_shift;
|
||||
pub mod table_fold;
|
||||
pub mod thresholds;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
//! How much a profile is worth: its sample. Opponent statistics come without a hand count, so
|
||||
//! the caller sends one (`villains[].profile.hands`, extension, not in VERTRAG.md). Few hands
|
||||
//! mean the numbers are mostly noise; they are pulled toward the population before anything
|
||||
//! reads them.
|
||||
//!
|
||||
//! | step | rule |
|
||||
//! |---|---|
|
||||
//! | trust | `w = hands / (hands + PRIOR_HANDS)`; no, negative or broken count: 0 |
|
||||
//! | shrink | each known frequency `x` becomes `p + w * (x - p)` with the population `p` in `PRIOR` |
|
||||
//! | absent | a missing frequency stays missing; a profile without `hands` is used as given |
|
||||
|
||||
use crate::exploit::profile::Profile;
|
||||
|
||||
/// Hands at which the sample and the population weigh the same (`trust` 0.5).
|
||||
pub const PRIOR_HANDS: f64 = 30.0;
|
||||
|
||||
/// The population an unknown opponent is assumed to be: a regular of the stock.
|
||||
pub const PRIOR: Profile = Profile {
|
||||
vpip: Some(0.28),
|
||||
pfr: Some(0.18),
|
||||
fold_to_bet: Some(0.45),
|
||||
aggression: Some(0.35),
|
||||
};
|
||||
|
||||
/// Weight of the sample in `[0, 1)`.
|
||||
pub fn trust(hands: f64) -> f64 {
|
||||
if hands.is_nan() || hands <= 0.0 {
|
||||
return 0.0;
|
||||
}
|
||||
hands / (hands + PRIOR_HANDS)
|
||||
}
|
||||
|
||||
fn pull(x: Option<f64>, p: Option<f64>, w: f64) -> Option<f64> {
|
||||
match (x.filter(|v| !v.is_nan()), p) {
|
||||
(Some(x), Some(p)) => Some(p + w * (x - p)),
|
||||
(x, _) => x,
|
||||
}
|
||||
}
|
||||
|
||||
/// The profile as the engine should believe it after `hands` hands.
|
||||
pub fn shrink(profile: &Profile, hands: f64) -> Profile {
|
||||
let w = trust(hands);
|
||||
Profile {
|
||||
vpip: pull(profile.vpip, PRIOR.vpip, w),
|
||||
pfr: pull(profile.pfr, PRIOR.pfr, w),
|
||||
fold_to_bet: pull(profile.fold_to_bet, PRIOR.fold_to_bet, w),
|
||||
aggression: pull(profile.aggression, PRIOR.aggression, w),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user