Public Member Functions | Private Member Functions | Friends | List of all members
tuw::StateSim Class Referenceabstract

Interface for a state simulator structure that performs numerical integration of not-closed-form state variables. More...

#include <state_sim.h>

Inheritance diagram for tuw::StateSim:
Inheritance graph
[legend]

Public Member Functions

virtual void advance (double _arc)=0
 Performs one simulation step to parametrized arc length _arc. More...
 
virtual void advanceSet0 (const double &_tEnd, const double &_dt)
 
virtual StateSimUPtr cloneStateSim () const =0
 Clone-to-base-class-ptr function. More...
 
StateSimoperator= (const StateSim &)=default
 
StateSimoperator= (StateSim &&)=delete
 
virtual ParamFuncsparamFuncs ()=0
 Returns (if applicable) reference of the parametric functions structure. Otherwise returns nullptr. More...
 
virtual ParamFuncsDistparamFuncsDist ()=0
 Returns (if applicable) reference of the parametric functions distance-extended structure. Otherwise returns nullptr. More...
 
virtual void setDiscrType (const RungeKutta::DiscretizationType &_discrType)=0
 Set discretization type used in the simulation. More...
 
virtual void setState (StateSPtr &_otherState)=0
 Sets the state variables to the values of _otherState. It also sets the control structure evaluation point at most at the new arc parametrization (if applicable). More...
 
virtual void setStateCf (const double &_arc, const ParamFuncs::EvalArcGuarantee &_evalArcGuarantee=ParamFuncs::EvalArcGuarantee::AFTER_LAST)=0
 Sets closed-form state at arc _arc. More...
 
virtual void setStateCfNmStep (const double &_arc, const ParamFuncs::EvalArcGuarantee &_evalArcGuarantee=ParamFuncs::EvalArcGuarantee::AFTER_LAST)
 
virtual Statestate0 ()=0
 Reference to the initial state. More...
 
virtual double stateArc () const =0
 Value of the current arc parametrization of the state. More...
 
virtual StatestateCf ()=0
 Reference to the actual closed-form state. More...
 
virtual double stateDist () const =0
 Value of the current traveled distance of the state. More...
 
virtual StatestateNm ()=0
 Reference to the actual numerical-computed state. More...
 
 StateSim ()=default
 
 StateSim (const StateSim &)=default
 
 StateSim (StateSim &&)=delete
 
virtual void toState0 ()=0
 Resets entire state to state0. It also sets the control structure evaluation point at most at the new arc parametrization (if applicable). More...
 
virtual ~StateSim ()=default
 
- Public Member Functions inherited from tuw::State
virtual StateSPtr cloneState () const =0
 Clone-to-base-class-ptr function. More...
 
void fromEIGENVec (const Eigen::VectorXd &_vec)
 Copies all values from an Eigen vector. The valueSize of the State object has to be equal with the Eigen vector size. More...
 
void fromSTLVec (const std::vector< double > &_vec)
 Copies all values from an STL vector. The valueSize of the State object has to be equal with the STL vector size. More...
 
Stateoperator= (const State &)=default
 
Stateoperator= (State &&)=default
 
virtual void resize (const size_t &_i)
 Resizes the array. More...
 
 State (State *_parent)
 
 State ()
 
 State (const State &)=default
 
 State (State &&)=default
 
virtual StateSPtrstate (const std::size_t &_i)
 Access sub-state based on index _i. More...
 
virtual size_t stateSize () const
 Size of the sub-states. More...
 
void toEIGENVec (Eigen::VectorXd &_vec)
 Converts all the array values to an Eigen vector. More...
 
void toSTLVec (std::vector< double > &_vec)
 Converts all the array values to an STL vector. More...
 
virtual void updateSize ()
 Performs internal manipulation when any of the underlying arrays are being resized. More...
 
virtual double & value (const std::size_t &_i)=0
 Access state variable based on index _i. More...
 
virtual const double & value (const std::size_t &_i) const =0
 Const access state variable based on index _i. More...
 
virtual size_t valueSize () const =0
 Size of the state variables. More...
 
virtual ~State ()=default
 

Private Member Functions

virtual StatestateNmDelta (const double &_dArc)=0
 Computes numerical discrete state transition (return) based on internal closed-form state (stateCf ) and discretization interval _dArc. More...
 
virtual StatestateNmDot ()=0
 Computes numerical continuous arc state transition (return) based on internal closed-form state (stateCf ). More...
 

Friends

template<std::size_t StateSize, std::size_t RKOrder, typename... RKCoeff>
void RungeKutta::discretize (StateSim &_stateSim, const double &_arc)
 
template<std::size_t StateSize, std::size_t StateNmSize>
class StateSimTemplate
 

Additional Inherited Members

- Static Public Member Functions inherited from tuw::State
static std::vector< double > & minus (State &_lhs, State &_rhs, std::vector< double > &_ans)
 Performs substraction. Left and right operand are required to have the same valueSize. More...
 
static Eigen::VectorXd & minus (State &_lhs, State &_rhs, Eigen::VectorXd &_ans)
 Performs substraction. Left and right operand are required to have the same valueSize. More...
 
static Stateminus (State &_lhs, State &_rhs, State &_ans)
 Performs substraction. Answer variable, left operand and right operand are required to have the same valueSize. More...
 
static std::vector< double > & plus (State &_lhs, State &_rhs, std::vector< double > &_ans)
 Performs addition. Left and right operand are required to have the same valueSize. More...
 
static Eigen::VectorXd & plus (State &_lhs, State &_rhs, Eigen::VectorXd &_ans)
 Performs addition. Left and right operand are required to have the same valueSize. More...
 
static Stateplus (State &_lhs, State &_rhs, State &_ans)
 Performs addition. Answer variable, left operand and right operand are required to have the same valueSize. More...
 
- Protected Member Functions inherited from tuw::State
void callRootUpdateSize ()
 Calls (if present) the parent updateSize procedure. Otherwise performs root updateSize. More...
 
- Protected Attributes inherited from tuw::State
Stateparent_
 Pointer to the parent State structure. More...
 

Detailed Description

Interface for a state simulator structure that performs numerical integration of not-closed-form state variables.

Todo:
cout the the state variables (horizontally) (override to split on Nm and Cf?)

Definition at line 58 of file state_sim.h.

Constructor & Destructor Documentation

tuw::StateSim::StateSim ( )
default
virtual tuw::StateSim::~StateSim ( )
virtualdefault
tuw::StateSim::StateSim ( const StateSim )
default
tuw::StateSim::StateSim ( StateSim &&  )
delete

Member Function Documentation

virtual void tuw::StateSim::advance ( double  _arc)
pure virtual

Performs one simulation step to parametrized arc length _arc.

Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >.

virtual void tuw::StateSim::advanceSet0 ( const double &  _tEnd,
const double &  _dt 
)
inlinevirtual

Definition at line 113 of file state_sim.h.

virtual StateSimUPtr tuw::StateSim::cloneStateSim ( ) const
pure virtual

Clone-to-base-class-ptr function.

StateSim& tuw::StateSim::operator= ( const StateSim )
default
StateSim& tuw::StateSim::operator= ( StateSim &&  )
delete
virtual ParamFuncs* tuw::StateSim::paramFuncs ( )
pure virtual

Returns (if applicable) reference of the parametric functions structure. Otherwise returns nullptr.

virtual ParamFuncsDist* tuw::StateSim::paramFuncsDist ( )
pure virtual

Returns (if applicable) reference of the parametric functions distance-extended structure. Otherwise returns nullptr.

virtual void tuw::StateSim::setDiscrType ( const RungeKutta::DiscretizationType _discrType)
pure virtual

Set discretization type used in the simulation.

Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >.

virtual void tuw::StateSim::setState ( StateSPtr _otherState)
pure virtual

Sets the state variables to the values of _otherState. It also sets the control structure evaluation point at most at the new arc parametrization (if applicable).

Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >.

virtual void tuw::StateSim::setStateCf ( const double &  _arc,
const ParamFuncs::EvalArcGuarantee _evalArcGuarantee = ParamFuncs::EvalArcGuarantee::AFTER_LAST 
)
pure virtual

Sets closed-form state at arc _arc.

virtual void tuw::StateSim::setStateCfNmStep ( const double &  _arc,
const ParamFuncs::EvalArcGuarantee _evalArcGuarantee = ParamFuncs::EvalArcGuarantee::AFTER_LAST 
)
inlinevirtual

Definition at line 150 of file state_sim.h.

virtual State& tuw::StateSim::state0 ( )
pure virtual

Reference to the initial state.

Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >.

virtual double tuw::StateSim::stateArc ( ) const
pure virtual

Value of the current arc parametrization of the state.

virtual State& tuw::StateSim::stateCf ( )
pure virtual

Reference to the actual closed-form state.

Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >.

virtual double tuw::StateSim::stateDist ( ) const
pure virtual

Value of the current traveled distance of the state.

virtual State& tuw::StateSim::stateNm ( )
pure virtual

Reference to the actual numerical-computed state.

Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >.

virtual State& tuw::StateSim::stateNmDelta ( const double &  _dArc)
privatepure virtual

Computes numerical discrete state transition (return) based on internal closed-form state (stateCf ) and discretization interval _dArc.

virtual State& tuw::StateSim::stateNmDot ( )
privatepure virtual

Computes numerical continuous arc state transition (return) based on internal closed-form state (stateCf ).

virtual void tuw::StateSim::toState0 ( )
pure virtual

Resets entire state to state0. It also sets the control structure evaluation point at most at the new arc parametrization (if applicable).

Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >.

Friends And Related Function Documentation

template<std::size_t StateSize, std::size_t RKOrder, typename... RKCoeff>
void RungeKutta::discretize ( StateSim _stateSim,
const double &  _arc 
)
friend
template<std::size_t StateSize, std::size_t StateNmSize>
friend class StateSimTemplate
friend

Definition at line 167 of file state_sim.h.


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


tuw_control
Author(s): George Todoran
autogenerated on Mon Jun 10 2019 15:27:23