shark::SinglePole Class Reference

#include <shark/ObjectiveFunctions/Benchmarks/PoleSimulators/SinglePole.h>

Public Member Functions

unsigned noVars () const
 Number of variables. More...
 
 SinglePole (bool markovian, bool normalize=true)
 
void initDegree (double state2init)
 Initialize with specific pole angle. More...
 
void init (double state2init=0.07)
 Initialize with specific pole angle. More...
 
void init (double a, double b, double c, double d)
 Initialize full m_state. More...
 
void getState (RealVector &v)
 Place m_state in a vector. More...
 
bool failure ()
 Returns true when this pole is in an illegal position. More...
 
void move (double output)
 Move the pole with some force. More...
 

Static Public Member Functions

static double degrad (double x)
 Convert degrees to radians. More...
 

Detailed Description

Definition at line 50 of file SinglePole.h.

Constructor & Destructor Documentation

◆ SinglePole()

shark::SinglePole::SinglePole ( bool  markovian,
bool  normalize = true 
)
inline
Parameters
markovianWhether to return velocities in getState
normalizeWhether to normalize return values in getState

Definition at line 67 of file SinglePole.h.

Member Function Documentation

◆ degrad()

static double shark::SinglePole::degrad ( double  x)
inlinestatic

Convert degrees to radians.

Definition at line 54 of file SinglePole.h.

Referenced by failure().

◆ failure()

bool shark::SinglePole::failure ( )
inline

Returns true when this pole is in an illegal position.

Definition at line 128 of file SinglePole.h.

References degrad().

Referenced by shark::MarkovPole< HiddenNeuron, OutputNeuron >::eval().

◆ getState()

void shark::SinglePole::getState ( RealVector &  v)
inline

Place m_state in a vector.

Parameters
vvector to place m_state in (assumed to be correct size already)

Definition at line 113 of file SinglePole.h.

Referenced by shark::NonMarkovPole::eval(), and shark::MarkovPole< HiddenNeuron, OutputNeuron >::eval().

◆ init() [1/2]

void shark::SinglePole::init ( double  state2init = 0.07)
inline

Initialize with specific pole angle.

Parameters
state2initinitial pole angle (in radians)

Definition at line 94 of file SinglePole.h.

Referenced by shark::NonMarkovPole::eval(), shark::MarkovPole< HiddenNeuron, OutputNeuron >::eval(), and initDegree().

◆ init() [2/2]

void shark::SinglePole::init ( double  a,
double  b,
double  c,
double  d 
)
inline

Initialize full m_state.

Parameters
ainitial cart position
binitial cart velocity
cinitial pole angle (in radians)
dinitial pole angular velocity

Definition at line 104 of file SinglePole.h.

◆ initDegree()

void shark::SinglePole::initDegree ( double  state2init)
inline

Initialize with specific pole angle.

Parameters
state2initinitial pole angle (in degrees)

Definition at line 87 of file SinglePole.h.

References init().

◆ move()

void shark::SinglePole::move ( double  output)
inline

Move the pole with some force.

Parameters
outputForce to apply. Expects values in [0,1], where values below 0.5 indicate applying force towards the left side and values above indicate force towards the right.

Definition at line 137 of file SinglePole.h.

Referenced by shark::MarkovPole< HiddenNeuron, OutputNeuron >::eval().

◆ noVars()

unsigned shark::SinglePole::noVars ( ) const
inline

Number of variables.

Definition at line 59 of file SinglePole.h.


The documentation for this class was generated from the following file: