17 #include "cart_pole.h" 19 #include <third_party/box2d/box2d.h> 25 World(
float initial_angle,
const CartPole* domain);
32 float cartDistance()
const {
return cart_->GetPosition().x; }
33 float cartVelocity()
const {
return cart_->GetLinearVelocity().x; }
34 float poleAngle()
const {
return pole_->GetAngle(); }
35 float poleAngularVelocity()
const {
return pole_->GetAngularVelocity(); }
38 void moveCart(
float force);
40 const CartPole* domain()
const {
return domain_; }
42 b2World* box2dWorld() {
return &b2_world_; }
47 b2Body* cart_ =
nullptr;
48 b2Body* pole_ =
nullptr;
50 const CartPole* domain_ =
nullptr;