pub trait Env {
    type Config: Clone;
    type Obs: Obs;
    type Act: Act;
    type Info: Info;
    fn build(config: &Self::Config, seed: i64) -> Result<Self>
    where
        Self: Sized
;
fn step(&mut self, a: &Self::Act) -> (Step<Self>, Record)
    where
        Self: Sized
;
fn reset(&mut self, is_done: Option<&Vec<i8>>) -> Result<Self::Obs>;
fn step_with_reset(&mut self, a: &Self::Act) -> (Step<Self>, Record)
    where
        Self: Sized
; }
Expand description

Represents an environment, typically an MDP.

Associated Types

Configurations.

Observation of the environment.

Action of the environment.

Information in the self::Step object.

Required methods

Builds an environment with a given random seed.

Performes an environment step.

Resets the environment if is_done[0] == 1. or is_done.is_none().

Old versions of the library supports vectorized environments and is_done was used to reset a part of the vectorized environments. Currenly, vecorized environment is not supported and is_done.len() is expected to be 1.

Performes an environment step and reset the environment if an episode ends.

Implementors