pub struct BreakoutState<B: Backend> {
pub time: I32<B>,
pub ball_y: I32<B>,
pub ball_x: I32<B>,
pub ball_dir: I32<B>,
pub pos: I32<B>,
pub brick_map: Array<B, f32>,
pub strike: Bool<B>,
pub last_y: I32<B>,
pub last_x: I32<B>,
pub terminal: Bool<B>,
}Expand description
The state of a Breakout episode. The fields are in the order of gymnax’s
EnvState leaves.
Fields§
§time: I32<B>Steps taken in the episode.
ball_y: I32<B>The row of the ball.
ball_x: I32<B>The column of the ball.
ball_dir: I32<B>The direction of the ball: 0 up-left, 1 up-right, 2 down-right, 3 down-left.
pos: I32<B>The column of the paddle.
brick_map: Array<B, f32>The bricks (f32[10, 10], ones where a brick is).
strike: Bool<B>Whether the ball hit a brick in the previous step.
last_y: I32<B>The previous row of the ball.
last_x: I32<B>The previous column of the ball.
terminal: Bool<B>Whether the episode ended.
Trait Implementations§
Source§impl<B: Backend> Tree<B> for BreakoutState<B>
impl<B: Backend> Tree<B> for BreakoutState<B>
Source§type On<__RuxlaC: Backend> = BreakoutState<__RuxlaC>
type On<__RuxlaC: Backend> = BreakoutState<__RuxlaC>
The same structure on backend
C.Source§fn unflatten_like(
&self,
leaves: &mut dyn Iterator<Item = <B as Backend>::Leaf>,
) -> Self
fn unflatten_like( &self, leaves: &mut dyn Iterator<Item = <B as Backend>::Leaf>, ) -> Self
Builds a value of the same structure from leaves.
Auto Trait Implementations§
impl<B> Freeze for BreakoutState<B>
impl<B> RefUnwindSafe for BreakoutState<B>where
<B as Backend>::Scalar<i32>: RefUnwindSafe,
<B as Backend>::Array<f32>: RefUnwindSafe,
<B as Backend>::Scalar<bool>: RefUnwindSafe,
impl<B> Send for BreakoutState<B>
impl<B> Sync for BreakoutState<B>
impl<B> Unpin for BreakoutState<B>
impl<B> UnsafeUnpin for BreakoutState<B>where
<B as Backend>::Scalar<i32>: UnsafeUnpin,
<B as Backend>::Array<f32>: UnsafeUnpin,
<B as Backend>::Scalar<bool>: UnsafeUnpin,
impl<B> UnwindSafe for BreakoutState<B>where
<B as Backend>::Scalar<i32>: UnwindSafe,
<B as Backend>::Array<f32>: UnwindSafe,
<B as Backend>::Scalar<bool>: 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