pub struct DirectSamplerCore<E: Env> { /* private fields */ }Expand description
Mutable direct-sampler state exposed to DirectSamplerHook implementations.
Implementations§
Source§impl<E: Env> DirectSamplerCore<E>
impl<E: Env> DirectSamplerCore<E>
Sourcepub fn buffers_mut(&mut self) -> &mut ArrayHandle<TrajectoryBuffer<E::Tensor>>
pub fn buffers_mut(&mut self) -> &mut ArrayHandle<TrajectoryBuffer<E::Tensor>>
Returns the per-environment output buffers.
Sourcepub fn reset_all_envs(&mut self) -> Result<()>
pub fn reset_all_envs(&mut self) -> Result<()>
Resets every worker environment and clears its active episode state.
§Errors
Returns an error if an environment cannot be reset or a worker is interrupted.
Sourcepub fn build<EB: EnvBuilder<Env = E>>(
env_builder: EnvBuilderType<EB>,
execution_mode: SamplerExecutionMode,
) -> Self
pub fn build<EB: EnvBuilder<Env = E>>( env_builder: EnvBuilderType<EB>, execution_mode: SamplerExecutionMode, ) -> Self
Builds sampler state from an environment collection and execution mode.
§Panics
Panics if an environment cannot be built.
Auto Trait Implementations§
impl<E> !RefUnwindSafe for DirectSamplerCore<E>
impl<E> !Sync for DirectSamplerCore<E>
impl<E> !UnwindSafe for DirectSamplerCore<E>
impl<E> Freeze for DirectSamplerCore<E>
impl<E> Send for DirectSamplerCore<E>
impl<E> Unpin for DirectSamplerCore<E>
impl<E> UnsafeUnpin for DirectSamplerCore<E>
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