Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Spaces

Space associates an Item type with four operations: sample, contains, shape, and bounds. EnvSpace<S, A> pairs the state and action spaces exposed by an environment.

TypeItemMeaning
Boxed<D>SVector<f64, D>Fixed-size continuous box with elementwise bounds
Discreteu32Integer values \(0,\ldots,n-1\)
MultiDiscreteVec<u32>Product of discrete ranges
Mixed<D>MixedItem<D>Either a discrete space or a continuous Boxed<D> selected at construction

Classic Control and LunarLander use Mixed so action mode is encoded in both the configured space and the action value. Passing a continuous item to a discrete instance, or the reverse, is an error. MuJoCo environments use dynamically sized DVector<f64> actions because custom XML can change nu.