Implementation of the state of Cart Pole. 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
 Get the angle. More...

 
double & Angle ()
 Modify the angle. More...

 
double AngularVelocity () const
 Get the angular velocity. More...

 
double & AngularVelocity ()
 Modify the angular velocity. More...

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

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

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

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

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

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

 

Static Public Attributes

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

 

Detailed Description

Implementation of the state of Cart Pole.

Each state is a tuple vector (position, velocity, angle, angular velocity).

Definition at line 33 of file cart_pole.hpp.

Constructor & Destructor Documentation

◆ State() [1/2]

State ( )
inline

Construct a state instance.

Definition at line 39 of file cart_pole.hpp.

Referenced by CartPole::InitialSample().

◆ 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 47 of file cart_pole.hpp.

Member Function Documentation

◆ Angle() [1/2]

double Angle ( ) const
inline

Get the angle.

Definition at line 64 of file cart_pole.hpp.

Referenced by CartPole::IsTerminal(), and CartPole::Sample().

◆ Angle() [2/2]

double& Angle ( )
inline

Modify the angle.

Definition at line 66 of file cart_pole.hpp.

◆ AngularVelocity() [1/2]

double AngularVelocity ( ) const
inline

Get the angular velocity.

Definition at line 69 of file cart_pole.hpp.

Referenced by CartPole::Sample().

◆ AngularVelocity() [2/2]

double& AngularVelocity ( )
inline

Modify the angular velocity.

Definition at line 71 of file cart_pole.hpp.

◆ Data()

arma::colvec& Data ( )
inline

Modify the internal representation of the state.

Definition at line 51 of file cart_pole.hpp.

◆ Encode()

const arma::colvec& Encode ( ) const
inline

Encode the state to a column vector.

Definition at line 74 of file cart_pole.hpp.

◆ Position() [1/2]

double Position ( ) const
inline

Get the position.

Definition at line 54 of file cart_pole.hpp.

Referenced by CartPole::IsTerminal(), and CartPole::Sample().

◆ Position() [2/2]

double& Position ( )
inline

Modify the position.

Definition at line 56 of file cart_pole.hpp.

◆ Velocity() [1/2]

double Velocity ( ) const
inline

Get the velocity.

Definition at line 59 of file cart_pole.hpp.

Referenced by CartPole::Sample().

◆ Velocity() [2/2]

double& Velocity ( )
inline

Modify the velocity.

Definition at line 61 of file cart_pole.hpp.

Member Data Documentation

◆ dimension

constexpr size_t dimension = 4
static

Dimension of the encoded state.

Definition at line 77 of file cart_pole.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/cart_pole.hpp