feat(spiel_bot): dqn
This commit is contained in:
parent
7c0f230e3d
commit
e7d13c9a02
9 changed files with 1192 additions and 0 deletions
12
spiel_bot/src/env/trictrac.rs
vendored
12
spiel_bot/src/env/trictrac.rs
vendored
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue