Trait gym_rs::core::Env

source ·
pub trait Env: Clone + Debug + Serialize + EnvPropertieswhere
    Self::Observation: Sample + Into<Vec<f64>>,{
    type Action;
    type Observation;
    type Info;
    type ResetInfo;

    // Required methods
    fn step(
        &mut self,
        action: Self::Action
    ) -> ActionReward<Self::Observation, Self::Info>;
    fn reset(
        &mut self,
        seed: Option<u64>,
        return_info: bool,
        options: Option<BoxR<Self::Observation>>
    ) -> (Self::Observation, Option<Self::ResetInfo>);
    fn render(&mut self, mode: RenderMode) -> Renders;
    fn close(&mut self);
}
Expand description

Defines a common set of operations available to different environments.

Required Associated Types§

source

type Action

The type of action supported.

source

type Observation

The type of the observation produced after an action has been applied.

source

type Info

The type of the metadata object produced by acting on the environment.

source

type ResetInfo

The type of the object produced when an environment is reset.

Required Methods§

source

fn step( &mut self, action: Self::Action ) -> ActionReward<Self::Observation, Self::Info>

Acts on an environment using the given action, producing a reward.

source

fn reset( &mut self, seed: Option<u64>, return_info: bool, options: Option<BoxR<Self::Observation>> ) -> (Self::Observation, Option<Self::ResetInfo>)

Resets the environment to a initial random state.

source

fn render(&mut self, mode: RenderMode) -> Renders

Produces the renders, if any, associated with the given mode.

source

fn close(&mut self)

Closes any open resources associated with the internal rendering service.

Implementors§