rlmesh::env::VectorEnv
A natively batched environment.
trait VectorEnvactions and observations use the batched layout: a Box, MultiBinary or
MultiDiscrete batch is one stacked Tensor of shape [num_envs, *shape], a Discrete batch one int64 Tensor of shape [num_envs], a
Dict or Tuple batch is batched per child, and any other kind is a List
of per-lane values. Returned observations may also give a stacked kind as
a List of per-lane values.
Also available as rlmesh::VectorEnv.
Required methods
Provided methods
num_envs
required method[source]fn num_envs(&self) -> u64The number of sub-environments stepped together.
single_observation_space
required method[source]fn single_observation_space(&self) -> SpaceThe space one sub-environment’s observation belongs to.
single_action_space
required method[source]fn single_action_space(&self) -> SpaceThe space one sub-environment’s action belongs to.
reset
required method[source]fn reset(
&mut self,
seed: Option<VectorSeed>,
options: Option<&InfoDict>,
) -> Result<(Value, InfoDict)>Reset every sub-environment.
step
required method[source]fn step(
&mut self,
actions: Value,
) -> Result<(Value, Vec<f64>, Vec<bool>, Vec<bool>, InfoDict)>Step every sub-environment with its action.
render
provided method[source]fn render(&mut self) -> Result<Option<Value>>The current frames, batched; None (the default) is no frame.
close
provided method[source]fn close(&mut self) -> Result<()>Release the env’s resources; the default does nothing.
render_mode
provided method[source]fn render_mode(&self) -> Option<String>The render mode; None by default.
metadata
provided method[source]fn metadata(&self) -> Option<Metadata>The metadata dictionary; None by default.
id
provided method[source]fn id(&self) -> Option<String>The environment identifier; None serves "UnknownEnv-v1".