Skip to main content

SnakeEnvSingle

Type Alias SnakeEnvSingle 

Source
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: i32

Grid width

§height: i32

Grid height

§snakes: Vec<Snake>

All snakes

§num_agents: usize

Number of agents

§food: Position

Food position

§episode: usize

Episode counter

§steps: usize

Step counter

§max_steps: usize

Maximum steps per episode

§done: bool

Done flag

§rng: StdRng

Owned RNG for food spawning. Captured by clone_state so that restore_state + step reproduces the exact same trajectory.