Skip to main content

RolloutCollector

Struct RolloutCollector 

Source
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>

Source

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.

Source

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.

Source

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>
where &'environment mut dyn Environment: Freeze, &'model dyn ActorCritic: Freeze,

§

impl<'environment, 'model> Move for RolloutCollector<'environment, 'model>

§

impl<'environment, 'model> Unpin for RolloutCollector<'environment, 'model>
where &'environment mut dyn Environment: Unpin, &'model dyn ActorCritic: Unpin,

§

impl<'environment, 'model> UnsafeUnpin for RolloutCollector<'environment, 'model>
where &'environment mut dyn Environment: UnsafeUnpin, &'model dyn ActorCritic: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.