rlmesh::env::RemoteVectorEnv
A client for a remote vector env (two or more lanes stepped in lockstep): A remote vector environment. Observations and actions are one batched Value; rewards and flags are per-lane vectors.
struct RemoteVectorEnvAlso available as rlmesh::RemoteVectorEnv.
Associated functions
Methods
- address()The canonical connect string of the dialed endpoint.
- env_id()This connection's container id (UUIDv7), distinct from the human env name (
env_contract().id()). - selected_workflow_edition()The workflow edition this connection negotiated, or the last edition a session pinned it to.
- env_contract()The contract the server reported at handshake.
- render_mode()The env's render mode, if any.
- metadata()The endpoint's metadata (empty when it reports none).
- observation_space_spec()The observation space spec reported by the endpoint.
- action_space_spec()The action space spec reported by the endpoint.
- cancel_handle()This handle's cancel token: firing it fails the call in flight, or the next call.
- render()Render lane
env_index(None= 0) as a uint8 frame, orNonewhen the env has no frame. - render_async()The async twin of
render. - close()Close this client's session (idempotent); the server keeps running.
- close_async()The async twin of
close. - shutdown()Ask the server to shut itself down (
None="owner shutdown"); true when it accepted, which closes this client. - shutdown_async()The async twin of
shutdown. - num_envs()Lanes the endpoint steps in lockstep.
- single_observation_space()One lane's observation space (built once).
- single_action_space()One lane's action space (built once).
- observation_space()The same object as
single_observation_space. - action_space()The same object as
single_action_space. - reset()Reset every lane: the batched observation and the info (with one
episode_idsentry per lane). - reset_async()The async twin of
reset. - step()Apply one batched action: the batched observation, per-lane rewards, terminated and truncated flags, and the info (
completed_episodesis the count of lanes whose episode ended). - step_async()The async twin of
step.
new
associated function[source]fn new(options: RemoteEnvOptions) -> Result<RemoteVectorEnv>Dial and handshake. An endpoint with fewer than two envs is refused (the ValueError class).
new_async
associated function[source]async fn new_async(options: RemoteEnvOptions) -> Result<RemoteVectorEnv>The async twin of new.
address
method[source]fn address(&self) -> &strThe canonical connect string of the dialed endpoint.
env_id
method[source]fn env_id(&self) -> &strThis connection’s container id (UUIDv7), distinct from the
human env name (env_contract().id()).
selected_workflow_edition
method[source]fn selected_workflow_edition(&self) -> &strThe workflow edition this connection negotiated, or the last edition a session pinned it to.
env_contract
method[source]fn env_contract(&self) -> &EnvContractThe contract the server reported at handshake.
render_mode
method[source]fn render_mode(&self) -> Option<&str>The env’s render mode, if any.
metadata
method[source]fn metadata(&self) -> &MetadataThe endpoint’s metadata (empty when it reports none).
observation_space_spec
method[source]fn observation_space_spec(&self) -> &SpaceSpecThe observation space spec reported by the endpoint.
action_space_spec
method[source]fn action_space_spec(&self) -> &SpaceSpecThe action space spec reported by the endpoint.
cancel_handle
method[source]fn cancel_handle(&self) -> CancelTokenThis handle’s cancel token: firing it fails the call in flight, or the next call.
render
method[source]fn render(&mut self, env_index: Option<u64>) -> Result<Option<Value>>Render lane env_index (None = 0) as a uint8 frame, or
None when the env has no frame.
render_async
method[source]async fn render_async(
&mut self,
env_index: Option<u64>,
) -> Result<Option<Value>>The async twin of render.
close
method[source]fn close(&mut self) -> Result<()>Close this client’s session (idempotent); the server keeps running. Errors other than a lost connection or an expired bound are returned.
close_async
method[source]async fn close_async(&mut self) -> Result<()>The async twin of close.
shutdown
method[source]fn shutdown(&mut self, reason: Option<&str>) -> Result<bool>Ask the server to shut itself down (None = "owner shutdown"); true when it accepted, which closes this client.
shutdown_async
method[source]async fn shutdown_async(&mut self, reason: Option<&str>) -> Result<bool>The async twin of shutdown.
num_envs
method[source]fn num_envs(&self) -> u64Lanes the endpoint steps in lockstep.
single_observation_space
method[source]fn single_observation_space(&self) -> &SpaceOne lane’s observation space (built once).
single_action_space
method[source]fn single_action_space(&self) -> &SpaceOne lane’s action space (built once).
observation_space
method[source]fn observation_space(&self) -> &SpaceThe same object as single_observation_space.
action_space
method[source]fn action_space(&self) -> &SpaceThe same object as single_action_space.
reset
method[source]fn reset(
&mut self,
seed: Option<VectorSeed>,
options: Option<&InfoDict>,
) -> Result<(Value, InfoDict)>Reset every lane: the batched observation and the info (with one
episode_ids entry per lane). An int seed is sent as a one-element
list.
reset_async
method[source]async fn reset_async(
&mut self,
seed: Option<VectorSeed>,
options: Option<&InfoDict>,
) -> Result<(Value, InfoDict)>The async twin of reset.
step
method[source]fn step(
&mut self,
actions: Value,
) -> Result<(Value, Vec<f64>, Vec<bool>, Vec<bool>, InfoDict)>Apply one batched action: the batched observation, per-lane rewards,
terminated and truncated flags, and the info (completed_episodes is
the count of lanes whose episode ended).
step_async
method[source]async fn step_async(
&mut self,
actions: Value,
) -> Result<(Value, Vec<f64>, Vec<bool>, Vec<bool>, InfoDict)>The async twin of step.
Trait implementations
- impl Drop for RemoteVectorEnv
- impl Debug for RemoteVectorEnv
- impl<'a> From<&'a mut RemoteVectorEnv> for EnvTarget<'a>