DoublePoleCart::State Class Reference

Implementation of the state of Double Pole Cart. More...

Public Member Functions

 State ()
 Construct a state instance. More...

 
 State (const arma::colvec &data)
 Construct a state instance from given data. More...

 
double Angle (const size_t i) const
 Get the angle of the $i^{th}$ pole. More...

 
double & Angle (const size_t i)
 Modify the angle of the $i^{th}$ pole. More...

 
double AngularVelocity (const size_t i) const
 Get the angular velocity of the $i^{th}$ pole. More...

 
double & AngularVelocity (const size_t i)
 Modify the angular velocity of the $i^{th}$ pole. More...

 
arma::colvec Data () const
 Get the internal representation of the state. More...

 
arma::colvec & Data ()
 Modify the internal representation of the state. More...

 
const arma::colvec & Encode () const
 Encode the state to a vector.. More...

 
double Position () const
 Get the position of the cart. More...

 
double & Position ()
 Modify the position of the cart. More...

 
double Velocity () const
 Get the velocity of the cart. More...

 
double & Velocity ()
 Modify the velocity of the cart. More...

 

Static Public Attributes

static constexpr size_t dimension = 6
 Dimension of the encoded state. More...

 

Detailed Description

Implementation of the state of Double Pole Cart.

The state is expressed as a vector (position, velocity, angle, angular velocity, angle, angular velocity)

Definition at line 35 of file double_pole_cart.hpp.

Constructor & Destructor Documentation

◆ State() [1/2]

State ( )
inline

Construct a state instance.

Definition at line 41 of file double_pole_cart.hpp.

Referenced by DoublePoleCart::InitialSample(), and DoublePoleCart::RK4().

◆ State() [2/2]

State ( const arma::colvec &  data)
inline

Construct a state instance from given data.

Parameters
dataData for the position, velocity, angle and angular velocity.

Definition at line 49 of file double_pole_cart.hpp.

Member Function Documentation

◆ Angle() [1/2]

double Angle ( const size_t  i) const
inline

Get the angle of the $i^{th}$ pole.

Definition at line 68 of file double_pole_cart.hpp.

Referenced by DoublePoleCart::Dsdt(), and DoublePoleCart::IsTerminal().

◆ Angle() [2/2]

double& Angle ( const size_t  i)
inline

Modify the angle of the $i^{th}$ pole.

Definition at line 70 of file double_pole_cart.hpp.

◆ AngularVelocity() [1/2]

double AngularVelocity ( const size_t  i) const
inline

Get the angular velocity of the $i^{th}$ pole.

Definition at line 73 of file double_pole_cart.hpp.

Referenced by DoublePoleCart::Dsdt(), and DoublePoleCart::Sample().

◆ AngularVelocity() [2/2]

double& AngularVelocity ( const size_t  i)
inline

Modify the angular velocity of the $i^{th}$ pole.

Definition at line 75 of file double_pole_cart.hpp.

◆ Data() [1/2]

arma::colvec Data ( ) const
inline

Get the internal representation of the state.

Definition at line 53 of file double_pole_cart.hpp.

Referenced by DoublePoleCart::RK4().

◆ Data() [2/2]

arma::colvec& Data ( )
inline

Modify the internal representation of the state.

Definition at line 55 of file double_pole_cart.hpp.

◆ Encode()

const arma::colvec& Encode ( ) const
inline

Encode the state to a vector..

Definition at line 78 of file double_pole_cart.hpp.

◆ Position() [1/2]

double Position ( ) const
inline

Get the position of the cart.

Definition at line 58 of file double_pole_cart.hpp.

Referenced by DoublePoleCart::IsTerminal().

◆ Position() [2/2]

double& Position ( )
inline

Modify the position of the cart.

Definition at line 60 of file double_pole_cart.hpp.

◆ Velocity() [1/2]

double Velocity ( ) const
inline

Get the velocity of the cart.

Definition at line 63 of file double_pole_cart.hpp.

Referenced by DoublePoleCart::Sample().

◆ Velocity() [2/2]

double& Velocity ( )
inline

Modify the velocity of the cart.

Definition at line 65 of file double_pole_cart.hpp.

Member Data Documentation

◆ dimension

constexpr size_t dimension = 6
static

Dimension of the encoded state.

Definition at line 81 of file double_pole_cart.hpp.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/reinforcement_learning/environment/double_pole_cart.hpp