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