use rapier2d::dynamics::RigidBodyHandle;
use rlevo_core::base::State;
use super::observation::CarRacingObservation;
#[derive(Debug, Clone)]
pub struct CarRacingState {
pub car_handle: RigidBodyHandle,
pub wheel_handles: [RigidBodyHandle; 4],
pub current_tile: usize,
pub tiles_visited: usize,
pub total_tiles: usize,
pub lap_complete: bool,
pub last_obs: CarRacingObservation,
}
impl State<3> for CarRacingState {
type Observation = CarRacingObservation;
fn shape() -> [usize; 3] {
[96, 96, 3]
}
fn is_valid(&self) -> bool {
true
}
fn observe(&self) -> CarRacingObservation {
self.last_obs.clone()
}
}