Implementing an environment
Place a new environment under the appropriate backend with config.rs, env.rs, and mod.rs; keep model assets and backend helpers beside it.
- Define a configuration with documented defaults and meaningful builder methods where fields are private.
- Define exact
State,Action, andInfotypes and anEnvSpacewhen the dimensions are static. - Make seeded resets reproducible, clear the step counter, and initialize every backend state used by
state(). - Validate action kind, dimension, and bounds before applying it.
- Return an
Experiencecontaining the pre-step and post-step observations and a correctTerminalvalue. - Keep task termination separate from the configured time limit.
- Test valid transitions, invalid actions, boundaries, seeded resets, rewards, and simultaneous terminal/truncation behavior.
- Export the environment and config from
mod.rsand add a specification page using the common environment template.
For MuJoCo, gate exports behind the mujoco feature, embed the default XML, derive dimensions from the loaded model, and document required body/site names for custom XML.