OpenANN  1.1.0
An open source library for artificial neural networks.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DoublePoleBalancing.h
Go to the documentation of this file.
1 #ifndef DOUBLE_POLE_BALANCING_H_
2 #define DOUBLE_POLE_BALANCING_H_
3 
5 #include <Eigen/Core>
6 
17 {
19  bool fullyObservable;
21  double gravity;
23  double cartMass;
25  double tau;
27  double pole1Mass;
29  double pole2Mass;
31  double pole1Length;
33  double pole2Length;
35  double mup;
37  double muc;
39  double initialPoleAngularPosition1;
44  double maxCartPosition;
46  double maxPoleAngularPosition1;
48  double maxPoleAngularPosition2;
50  int maxSteps;
52  double maxForce;
53 
54  double massLength1;
55  double massLength2;
56 
57  Environment::Action actionSpaceLo;
58  Environment::Action actionSpaceHi;
59  Environment::State stateSpaceLo;
60  Environment::State StateSpaceHi;
62  Environment::State stateNormalizationVector;
63 
64  Environment::Action action;
65  Environment::State state;
66  Environment::State normalizedState;
67  int step;
68 public:
69  DoublePoleBalancing(bool fullyObservable = true);
70  virtual bool actionSpaceContinuous() const;
71  virtual int actionSpaceDimension() const;
72  virtual int actionSpaceElements() const;
73  virtual double deltaT() const;
74  virtual const Action& actionSpaceLowerBound() const;
75  virtual const Action& actionSpaceUpperBound() const;
76  virtual const Action& getAction() const;
77  virtual const ActionSpace::A& getDiscreteActionSpace() const;
78  virtual const StateSpace::S& getDiscreteStateSpace() const;
79  virtual const State& getState() const;
80  virtual void restart();
81  virtual double reward() const;
82  virtual bool stateSpaceContinuous() const;
83  virtual int stateSpaceDimension() const;
84  virtual int stateSpaceElements() const;
85  virtual const State& stateSpaceLowerBound() const;
86  virtual const State& stateSpaceUpperBound() const;
87  virtual void stateTransition(const Action& action);
88  virtual int stepsInEpisode() const;
89  virtual bool successful() const;
90  virtual bool terminalState() const;
91 private:
92  void normalizeState();
93  State derivative(const State& state, double force);
94  State rk4(const State& state, double force, const State& derivative);
95 };
96 
97 #endif // DOUBLE_POLE_BALANCING_H_