shark::DoublePole Class Reference

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

Public Member Functions

unsigned noVars () const
 Number of variables. More...
 
 DoublePole (bool markovian, bool normalize=true)
 
void getState (RealVector &v)
 Place m_state in a vector. More...
 
void init (double state2init=0.07)
 Initialize with specific angle for large pole. More...
 
void initDegree (double state2init)
 Initialize with specific angle for large pole. More...
 
void init (double a, double b, double c, double d, double e=0., double f=0.)
 Initialize full m_state. More...
 
bool failure ()
 Returns true when this pole is in an illegal position. More...
 
double getJiggle ()
 Return "jiggle", abstract representation of how much the the cart oscillates. More...
 
void move (double output)
 Move the pole with some force. More...
 

Detailed Description

Definition at line 48 of file DoublePole.h.

Constructor & Destructor Documentation

◆ DoublePole()

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

Definition at line 60 of file DoublePole.h.

Member Function Documentation

◆ failure()

bool shark::DoublePole::failure ( )
inline

Returns true when this pole is in an illegal position.

Definition at line 129 of file DoublePole.h.

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

◆ getJiggle()

double shark::DoublePole::getJiggle ( )
inline

Return "jiggle", abstract representation of how much the the cart oscillates.

Definition at line 143 of file DoublePole.h.

◆ getState()

void shark::DoublePole::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 82 of file DoublePole.h.

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

◆ init() [1/2]

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

Initialize with specific angle for large pole.

Parameters
state2initinitial pole angle (in radians)

Definition at line 101 of file DoublePole.h.

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

◆ init() [2/2]

void shark::DoublePole::init ( double  a,
double  b,
double  c,
double  d,
double  e = 0.,
double  f = 0. 
)
inline

Initialize full m_state.

Parameters
ainitial cart position
binitial cart velocity
cinitial large pole angle (in radians)
dinitial large pole angular velocity
einitial small pole angle (in radians)
finitial small pole angular velocity

Definition at line 119 of file DoublePole.h.

◆ initDegree()

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

Initialize with specific angle for large pole.

Parameters
state2initinitial pole angle (in degrees)

Definition at line 108 of file DoublePole.h.

References init().

◆ move()

void shark::DoublePole::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 149 of file DoublePole.h.

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

◆ noVars()

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

Number of variables.

Definition at line 52 of file DoublePole.h.


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