fgbase

Trait Env

Source
pub trait Env<Obs, Action> {
    // Required methods
    fn reset(&mut self);
    fn step(&mut self, action: &Action) -> (bool, f32);
    fn observe(&self, obs: &mut Obs);
}
Expand description

Main trait implement by each environements

Required Methods§

Source

fn reset(&mut self)

Reset function to restart the environement

Source

fn step(&mut self, action: &Action) -> (bool, f32)

Step function to take an action, return a tuple of (done, reward). Done will be true when the episode is finished and require to call .reset() next The reward is simply the reward signal.

Source

fn observe(&self, obs: &mut Obs)

This method is used get the observation, this is the main difference with the OpenAI gym, the goal is to be able to reuse objects and avoid allocation..

Implementors§