pub trait ReplayBufferBase {
type Config: Clone;
type Batch;
// Required methods
fn build(config: &Self::Config) -> Self;
fn batch(&mut self, size: usize) -> Result<Self::Batch>;
fn update_priority(
&mut self,
ixs: &Option<Vec<usize>>,
td_err: &Option<Vec<f32>>,
);
}
Expand description
Interface of replay buffers.
Ones implementing this trait generates a ReplayBufferBase::Batch
,
which is used to train agents.
Required Associated Types§
Required Methods§
Sourcefn build(config: &Self::Config) -> Self
fn build(config: &Self::Config) -> Self
Build a replay buffer from Self::Config.
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.