feat(spiel_bot): dqn

This commit is contained in:
Henri Bourcereau 2026-03-10 22:12:52 +01:00
parent 7c0f230e3d
commit e7d13c9a02
9 changed files with 1192 additions and 0 deletions

View file

@ -200,6 +200,18 @@ impl GameEnv for TrictracEnv {
}
}
// ── DQN helpers ───────────────────────────────────────────────────────────────
impl TrictracEnv {
/// Score snapshot for DQN reward computation.
///
/// Returns `[p1_total, p2_total]` where `total = holes × 12 + points`.
/// Index 0 = Player 1 (White, player_id 1), index 1 = Player 2 (Black, player_id 2).
pub fn score_snapshot(s: &GameState) -> [i32; 2] {
[s.total_score(1), s.total_score(2)]
}
}
// ── Tests ─────────────────────────────────────────────────────────────────────
#[cfg(test)]