Skip to main content

AgentEnvLoop

Trait AgentEnvLoop 

Source
pub trait AgentEnvLoop<RLC: RLComponentsTypes> {
    // Required methods
    fn run_steps(
        &mut self,
        num_steps: usize,
        processor: &mut RLEventProcessorType<RLC>,
        interrupter: &Interrupter,
        progress: &mut Progress,
    ) -> Vec<TimeStep<<RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>;
    fn run_episodes(
        &mut self,
        num_episodes: usize,
        processor: &mut RLEventProcessorType<RLC>,
        interrupter: &Interrupter,
        progress: &mut Progress,
    ) -> Vec<Trajectory<<RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>;
    fn update_policy(&mut self, update: RLC::PolicyState);
    fn policy(&self) -> RLC::PolicyState;
    fn device(&self) -> Device;
}
Available on crate feature rl only.
Expand description

Trait for a structure that implements an agent/environement interface.

Required Methods§

Source

fn run_steps( &mut self, num_steps: usize, processor: &mut RLEventProcessorType<RLC>, interrupter: &Interrupter, progress: &mut Progress, ) -> Vec<TimeStep<<RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>

Run a certain number of timesteps.

§Arguments
§Returns

A list of ordered timesteps.

Source

fn run_episodes( &mut self, num_episodes: usize, processor: &mut RLEventProcessorType<RLC>, interrupter: &Interrupter, progress: &mut Progress, ) -> Vec<Trajectory<<RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>

Run a certain number of episodes.

§Arguments
§Returns

A list of ordered timesteps.

Source

fn update_policy(&mut self, update: RLC::PolicyState)

Update the runner’s agent.

Source

fn policy(&self) -> RLC::PolicyState

Get the state of the runner’s agent.

Source

fn device(&self) -> Device

Returns the device on which the runner’s agent runs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<RLC> AgentEnvLoop<RLC> for AgentEnvAsyncLoop<RLC>
where RLC: RLComponentsTypes,

Source§

impl<RLC> AgentEnvLoop<RLC> for AgentEnvBaseLoop<RLC>
where RLC: RLComponentsTypes,

Source§

impl<RLC> AgentEnvLoop<RLC> for MultiAgentEnvLoop<RLC>
where RLC: RLComponentsTypes,