Environment

Trait Environment 

Source
pub trait Environment {
    // Required methods
    fn state(&self) -> Array1<f64>;
    fn num_actions(&self) -> usize;
    fn step(&mut self, action: usize) -> Result<(Array1<f64>, f64, bool)>;
    fn reset(&mut self) -> Array1<f64>;
}
Expand description

Environment for reinforcement learning

Required Methods§

Source

fn state(&self) -> Array1<f64>

Gets the current state

Source

fn num_actions(&self) -> usize

Gets the number of available actions

Source

fn step(&mut self, action: usize) -> Result<(Array1<f64>, f64, bool)>

Takes an action and returns the reward and next state

Source

fn reset(&mut self) -> Array1<f64>

Resets the environment

Implementors§