pub struct OnPolicyRuntime<A: Agent, S: Sampler> {
pub agent: A,
pub sampler: S,
}Expand description
Coupled runtime unit that binds an agent and sampler together.
Fields§
§agent: ATrainable agent.
sampler: SRollout collector.
Implementations§
Source§impl<A: Agent, S: Sampler> OnPolicyRuntime<A, S>
impl<A: Agent, S: Sampler> OnPolicyRuntime<A, S>
Sourcepub fn collect(&mut self) -> Result<(), Error>
pub fn collect(&mut self) -> Result<(), Error>
Collects a fresh set of rollouts using the sampler-facing actor.
§Errors
Returns an error if the sampler cannot collect the rollouts.
Sourcepub fn trajectory_containers(
&mut self,
) -> impl AsRef<[TrajectoryView<'_, S::Tensor>]>
pub fn trajectory_containers( &mut self, ) -> impl AsRef<[TrajectoryView<'_, S::Tensor>]>
Returns the last collected trajectory containers from the sampler.
Auto Trait Implementations§
impl<A, S> Freeze for OnPolicyRuntime<A, S>
impl<A, S> RefUnwindSafe for OnPolicyRuntime<A, S>where
A: RefUnwindSafe,
S: RefUnwindSafe,
impl<A, S> Send for OnPolicyRuntime<A, S>
impl<A, S> Sync for OnPolicyRuntime<A, S>
impl<A, S> Unpin for OnPolicyRuntime<A, S>
impl<A, S> UnsafeUnpin for OnPolicyRuntime<A, S>where
A: UnsafeUnpin,
S: UnsafeUnpin,
impl<A, S> UnwindSafe for OnPolicyRuntime<A, S>where
A: UnwindSafe,
S: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more