pub struct RolloutCollector<'environment, 'model> { /* private fields */ }Expand description
Environment-neutral categorical collector over borrowed owners.
Collection records one complete transaction and returns its exact Event without waiting. It owns no environment, model, rollout storage, Runtime, or queue.
Implementations§
Source§impl<'environment, 'model> RolloutCollector<'environment, 'model>
impl<'environment, 'model> RolloutCollector<'environment, 'model>
Sourcepub fn new(
environment: &'environment mut dyn Environment,
model: &'model dyn ActorCritic,
config: RolloutCollectorConfig,
) -> Result<Self>
pub fn new( environment: &'environment mut dyn Environment, model: &'model dyn ActorCritic, config: RolloutCollectorConfig, ) -> Result<Self>
Construct a checked same-device categorical collector.
§Errors
Returns an error for zero horizon/lanes, invalid environment metadata, a non-discrete action space, or model parameters owned by another Runtime.
Sourcepub fn collect(&mut self, rollout: &mut RolloutBuffer) -> Result<Event>
pub fn collect(&mut self, rollout: &mut RolloutBuffer) -> Result<Event>
Record and submit one complete categorical rollout without waiting.
§Errors
Returns an error for rollout mismatch, seed/counter overflow, environment, model, policy, GAE, capture, or queue submission failure. Recording errors cancel the complete transaction and rewind rollout/action host state.
Sourcepub const fn metrics(&self) -> RolloutCollectorMetrics
pub const fn metrics(&self) -> RolloutCollectorMetrics
Return accepted collection counters.
Auto Trait Implementations§
impl<'environment, 'model> !RefUnwindSafe for RolloutCollector<'environment, 'model>
impl<'environment, 'model> !Send for RolloutCollector<'environment, 'model>
impl<'environment, 'model> !Sync for RolloutCollector<'environment, 'model>
impl<'environment, 'model> !UnwindSafe for RolloutCollector<'environment, 'model>
impl<'environment, 'model> Forget for RolloutCollector<'environment, 'model>
impl<'environment, 'model> Freeze for RolloutCollector<'environment, 'model>
impl<'environment, 'model> Move for RolloutCollector<'environment, 'model>
impl<'environment, 'model> Unpin for RolloutCollector<'environment, 'model>
impl<'environment, 'model> UnsafeUnpin for RolloutCollector<'environment, 'model>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more