19 #include <core/sim/scene.h> 20 #include <core/sim/drone.h> 21 #include <core/sim/track.h> 22 #include <core/properties.h> 30 PROPERTY(drone_x,
float, 0,
"Drone x coordinate");
31 PROPERTY(drone_y,
float, 0,
"Drone y coordinate");
32 PROPERTY(drone_vx,
float, 0,
"Drone velocity (x component)");
33 PROPERTY(drone_vy,
float, 0,
"Drone velocity (y component)");
34 PROPERTY(drone_dir,
float, 0,
"Heading angle");
35 PROPERTY(distance,
int, 0,
"Track distance from the start (one lap is 1.0)");
40 static constexpr
float kWidth = 50;
41 static constexpr
float kHeight = 20;
44 explicit Scene(
const sim::Track* track,
const DroneTrack* domain);
46 const SceneVariables* variables()
const override {
return &variables_; }
48 const Config* config()
const override {
return &domain_->config(); }
50 sim::Drone* drone() {
return drone_.get(); }
52 const sim::Track* track()
const {
return track_; }
54 const DroneTrack* domain()
const {
return domain_; }
57 float fitness()
const;
59 void postStep(
float dt)
override;
62 void updateVariables();
68 unique_ptr<sim::Drone> drone_;
70 SceneVariables variables_;
71 const sim::Track* track_ =
nullptr;
72 const DroneTrack* domain_ =
nullptr;
High-level physics scene abstraction.
Definition: scene.h:42
Definition: domain.cpp:28
The foundation for data structures supporting runtime reflection.
Definition: properties.h:388