lesen/glueck.py: c = EQ[Starthand] - exaktes Mittel (E[c]=0 ueber das Austeilen), beta kreuzangepasst, stapelt mit der All-in-EV; Spec 9/9. glueck_sim: Hand-Export aus der Sim, um die Reduktion zu messen (151 echte Haende reichen dafuer nicht). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.9 KiB
Rust
41 lines
1.9 KiB
Rust
//! Plan M5: how much of a hand's result the dealt hole cards explain, measured where hands are cheap.
|
|
//!
|
|
//! Writes one line per hand (hero in every seat of every deal, 6-max): `opponent net luck hole`, with
|
|
//! `luck` the sim's full board-luck term (`sim::luck`, needs every player's cards - not available live)
|
|
//! and `hole` hero's two cards. `lesen/glueck.py` then compares the variance live estimators would have:
|
|
//! raw, hole-card luck only (what live can do), and the full sim correction (the ceiling).
|
|
//!
|
|
//! Run: `glueck_sim <out.csv> <deals-per-opponent>`.
|
|
|
|
use rechner::rng::Rng;
|
|
use rechner::sim::opponent::Opponent;
|
|
use rechner::sim::reader::Style;
|
|
use rechner::sim::table::{deal, play_hand_tracked, HandRead, HandSetup, TableCost};
|
|
use std::io::Write;
|
|
|
|
fn main() {
|
|
let a: Vec<String> = std::env::args().collect();
|
|
let out = &a[1];
|
|
let deals: u64 = a[2].parse().expect("deals");
|
|
let mut f = std::io::BufWriter::new(std::fs::File::create(out).expect("out"));
|
|
let gegner = [("reg", Opponent::Reader(Style::Reg)), ("fish", Opponent::Reader(Style::Fish)), ("station", Opponent::CallingStation), ("maniac", Opponent::Reader(Style::Maniac))];
|
|
for (name, opp) in gegner {
|
|
for d in 0..deals {
|
|
let (cards, _) = deal(6, Rng::seeded(0x61C0_0000 ^ d.wrapping_mul(0x9E37_79B9_7F4A_7C15)));
|
|
for seat in 1..=6u8 {
|
|
let hand = HandSetup {
|
|
deal: &cards,
|
|
hero_seat: seat,
|
|
opponent: opp,
|
|
stack_bb: 100.0,
|
|
seed: d.wrapping_mul(0xD1B5_4A32_D192_ED03) ^ seat as u64,
|
|
read: HandRead::Oracle,
|
|
};
|
|
let r = play_hand_tracked(&hand, TableCost::FREE, None);
|
|
let h = cards.holes[seat as usize - 1];
|
|
writeln!(f, "{name} {} {} {} {}", r.hero_net, r.luck, h[0].short(), h[1].short()).unwrap();
|
|
}
|
|
}
|
|
}
|
|
}
|