pub struct PendulumSwingUp { /* private fields */ }Expand description
Pendulum swing-up task with a continuous torque action.
See the module docs for the full observation/reward/dynamics specification and determinism contract.
Implementations§
Source§impl PendulumSwingUp
impl PendulumSwingUp
Sourcepub fn with_seed(seed: u64) -> Self
pub fn with_seed(seed: u64) -> Self
Create a new env with a custom reset seed.
Two envs constructed with the same seed produce identical episodes (same initial state on every reset).
Sourcepub fn with_seed_and_max_steps(seed: u64, max_steps: usize) -> Self
pub fn with_seed_and_max_steps(seed: u64, max_steps: usize) -> Self
Create a new env with a custom reset seed and episode length.
Trait Implementations§
Source§impl Clone for PendulumSwingUp
impl Clone for PendulumSwingUp
Source§fn clone(&self) -> PendulumSwingUp
fn clone(&self) -> PendulumSwingUp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PendulumSwingUp
impl Debug for PendulumSwingUp
Source§impl Default for PendulumSwingUp
impl Default for PendulumSwingUp
Source§impl Environment for PendulumSwingUp
impl Environment for PendulumSwingUp
Source§type Action = Vec<f32>
type Action = Vec<f32>
Continuous torque action. Length-1 Vec<f32>; values outside
[-MAX_TORQUE, MAX_TORQUE] are clamped. An empty vec is treated
as zero torque.
Source§type State = PendulumState
type State = PendulumState
Snapshot type. The dynamics are deterministic (no RNG), so
restore + step reproduces subsequent results exactly. The reset
RNG is not captured; see PendulumState.
Source§fn get_observation(&self) -> Vec<f32>
fn get_observation(&self) -> Vec<f32>
Get the current observation
Source§fn observation_space(&self) -> SpaceInfo
fn observation_space(&self) -> SpaceInfo
Get the observation space dimensions
Source§fn action_space(&self) -> SpaceInfo
fn action_space(&self) -> SpaceInfo
Get the action space dimensions
Source§fn clone_state(&self) -> PendulumState
fn clone_state(&self) -> PendulumState
Snapshot the current env state for later restoration. Read more
Source§fn restore_state(&mut self, state: &PendulumState)
fn restore_state(&mut self, state: &PendulumState)
Restore the env to a previously-snapshotted state. Read more
Auto Trait Implementations§
impl Freeze for PendulumSwingUp
impl RefUnwindSafe for PendulumSwingUp
impl Send for PendulumSwingUp
impl Sync for PendulumSwingUp
impl Unpin for PendulumSwingUp
impl UnsafeUnpin for PendulumSwingUp
impl UnwindSafe for PendulumSwingUp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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