pub type SnakeEnvSingle = SnakeEnv;Expand description
Backward-compatible alias for SnakeEnv; kept so older training scripts
that imported SnakeEnvSingle continue to compile. Prefer SnakeEnv in new
code.
Aliased Type§
pub struct SnakeEnvSingle {
pub width: i32,
pub height: i32,
pub snakes: Vec<Snake>,
pub num_agents: usize,
pub food: Position,
pub episode: usize,
pub steps: usize,
pub max_steps: usize,
pub done: bool,
pub rng: StdRng,
}Fields§
§width: i32Grid width
height: i32Grid height
snakes: Vec<Snake>All snakes
num_agents: usizeNumber of agents
food: PositionFood position
episode: usizeEpisode counter
steps: usizeStep counter
max_steps: usizeMaximum steps per episode
done: boolDone flag
rng: StdRngOwned RNG for food spawning. Captured by clone_state so that
restore_state + step reproduces the exact same trajectory.