Trait StepProcessor

Source
pub trait StepProcessor<E: Env> {
    type Config: Clone;
    type Output;

    // Required methods
    fn build(config: &Self::Config) -> Self;
    fn reset(&mut self, init_obs: E::Obs);
    fn process(&mut self, step: Step<E>) -> Self::Output;
}
Expand description

Process Step and output an item Self::Output.

This trait is used in Trainer. Step object is transformed to Self::Output, which will be pushed into a replay buffer implementing ExperienceBufferBase. The type Self::Output should be the same with ExperienceBufferBase::Item.

Required Associated Types§

Source

type Config: Clone

Configuration.

Source

type Output

The type of transitions produced by this trait.

Required Methods§

Source

fn build(config: &Self::Config) -> Self

Build a producer.

Source

fn reset(&mut self, init_obs: E::Obs)

Resets the object.

Source

fn process(&mut self, step: Step<E>) -> Self::Output

Processes a Step object.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§