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§
sourcetype Observation
type Observation
The type of the observation produced after an action has been applied.
Required Methods§
sourcefn step(
&mut self,
action: Self::Action
) -> ActionReward<Self::Observation, Self::Info>
fn step( &mut self, action: Self::Action ) -> ActionReward<Self::Observation, Self::Info>
Acts on an environment using the given action, producing a reward.
sourcefn reset(
&mut self,
seed: Option<u64>,
return_info: bool,
options: Option<BoxR<Self::Observation>>
) -> (Self::Observation, Option<Self::ResetInfo>)
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.
sourcefn render(&mut self, mode: RenderMode) -> Renders
fn render(&mut self, mode: RenderMode) -> Renders
Produces the renders, if any, associated with the given mode.