This reference describes unreleased code on main; no release documents it yet.

rlmesh::env::RemoteVectorEnv

structPreviewuse rlmesh::env::RemoteVectorEnv;[source]

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 RemoteVectorEnv

Also available as rlmesh::RemoteVectorEnv.

Associated functions

Methods

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) -> &str

The canonical connect string of the dialed endpoint.

env_id

method[source]
fn env_id(&self) -> &str

This connection’s container id (UUIDv7), distinct from the human env name (env_contract().id()).

selected_workflow_edition

method[source]
fn selected_workflow_edition(&self) -> &str

The workflow edition this connection negotiated, or the last edition a session pinned it to.

env_contract

method[source]
fn env_contract(&self) -> &EnvContract

The 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) -> &Metadata

The endpoint’s metadata (empty when it reports none).

observation_space_spec

method[source]
fn observation_space_spec(&self) -> &SpaceSpec

The observation space spec reported by the endpoint.

action_space_spec

method[source]
fn action_space_spec(&self) -> &SpaceSpec

The action space spec reported by the endpoint.

cancel_handle

method[source]
fn cancel_handle(&self) -> CancelToken

This 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) -> u64

Lanes the endpoint steps in lockstep.

single_observation_space

method[source]
fn single_observation_space(&self) -> &Space

One lane’s observation space (built once).

single_action_space

method[source]
fn single_action_space(&self) -> &Space

One lane’s action space (built once).

observation_space

method[source]
fn observation_space(&self) -> &Space

The same object as single_observation_space.

action_space

method[source]
fn action_space(&self) -> &Space

The 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>