pub struct CartPoleState {
pub x: f32,
pub x_dot: f32,
pub theta: f32,
pub theta_dot: f32,
pub steps: usize,
}Expand description
Snapshot of CartPole’s simulation state.
CartPole is fully deterministic on a per-step basis (the only RNG use is
inside reset_state, which is not called during stepping), so
restore_state followed by step(a) reproduces the same StepResult
as the original step at the time of snapshot.
Fields§
§x: f32Cart position
x_dot: f32Cart velocity
theta: f32Pole angle (radians)
theta_dot: f32Pole angular velocity
steps: usizeStep counter
Trait Implementations§
Source§impl Clone for CartPoleState
impl Clone for CartPoleState
Source§fn clone(&self) -> CartPoleState
fn clone(&self) -> CartPoleState
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 moreAuto Trait Implementations§
impl Freeze for CartPoleState
impl RefUnwindSafe for CartPoleState
impl Send for CartPoleState
impl Sync for CartPoleState
impl Unpin for CartPoleState
impl UnsafeUnpin for CartPoleState
impl UnwindSafe for CartPoleState
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