[][src]Trait coliseum::env::Environment

pub trait Environment<Action, ASample, Observation, OSample> where
    Action: Space<ASample>,
    Observation: Space<OSample>, 
{ fn reset(&mut self) -> OSample;
fn step(&mut self, action: ASample) -> State<OSample>; }

Required methods

fn reset(&mut self) -> OSample

Reset indicates that all environment state should be wiped and re-initialized. Analogous to starting a new game. Returns an observation from the newly initialized env.

fn step(&mut self, action: ASample) -> State<OSample>

Step takes an agent action and (probably) mutates itself; returns State to the agent.

Loading content...

Implementors

impl Environment<Discrete, u32, Discrete, u32> for RockPaperScissors[src]

Examples

use coliseum::env;
use env::{Environment, State};
use env::rock_paper_scissors::RockPaperScissors;

let mut game = RockPaperScissors::default();
game.reset();

// our player loves rock
let agent = || 1;

loop {
    let State { reward, done, .. } = game.step(agent());

    if done {
        break;
    }
}

fn reset(&mut self) -> u32[src]

Loading content...