oa::ml::ReplayBuffer

Circular fixed-capacity owner for off-policy transitions. Batched append and deterministic uniform sampling are recorded on the one owning engine. Cursor and size are host control metadata and never require a Matrix readback.

StRust public API

Declaration

pub struct ReplayBuffer { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn append(&mut self, transition: &ReplayTransition) -> Result<()>
pub fn sample(&self, batch_size: usize, seed: u64) -> Result<ReplayBatch>
pub fn reset(&mut self)
pub fn is_full(&self) -> bool
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub const fn capacity(&self) -> usize
pub const fn cursor(&self) -> usize
pub const fn config(&self) -> &ReplayConfig

Associated Functions

pub fn new(engine: &Engine, config: ReplayConfig) -> Result<Self>

Public Method Documentation

pub fn append(&mut self, transition: &ReplayTransition) -> Result<()>
No public source comment is attached to this declaration.
pub fn sample( &self, batch_size: usize, seed: u64 ) -> Result<ReplayBatch>
No public source comment is attached to this declaration.
pub fn reset( &mut self )
No public source comment is attached to this declaration.
pub fn is_full( &self ) -> bool
No public source comment is attached to this declaration.
pub const fn len( &self ) -> usize
No public source comment is attached to this declaration.
pub const fn is_empty( &self ) -> bool
No public source comment is attached to this declaration.
pub const fn capacity( &self ) -> usize
No public source comment is attached to this declaration.
pub const fn cursor( &self ) -> usize
No public source comment is attached to this declaration.
pub const fn config( &self ) -> &ReplayConfig
No public source comment is attached to this declaration.
pub fn new( engine: &Engine, config: ReplayConfig ) -> Result<Self>
No public source comment is attached to this declaration.