RcsPySim
A robot control and simulation library
Rcs::OMCombined Class Reference

#include <OMCombined.h>

Inheritance diagram for Rcs::OMCombined:
Collaboration diagram for Rcs::OMCombined:

Public Member Functions

virtual ~OMCombined ()
 
void addPart (ObservationModel *part)
 
virtual unsigned int getStateDim () const
 
virtual unsigned int getVelocityDim () const
 
virtual void computeObservation (double *state, double *velocity, const MatNd *currentAction, double dt) const
 
virtual void getLimits (double *minState, double *maxState, double *maxVelocity) const
 
virtual void reset ()
 
virtual std::vector< std::string > getStateNames () const
 
virtual std::vector< std::string > getVelocityNames () const
 
virtual std::vector< ObservationModel * > getNested () const
 
- Public Member Functions inherited from Rcs::ObservationModel
virtual ~ObservationModel ()
 
MatNd * computeObservation (const MatNd *currentAction, double dt) const
 
void computeObservation (MatNd *observation, const MatNd *currentAction, double dt) const
 
virtual void getMinMax (double *min, double *max) const final
 
virtual unsigned int getDim () const final
 
virtual std::vector< std::string > getNames () const final
 
template<typename OM >
OM * findModel ()
 
template<typename OM >
Offsets findOffsets ()
 
- Public Member Functions inherited from Rcs::BoxSpaceProvider
 BoxSpaceProvider ()
 
virtual ~BoxSpaceProvider ()
 
 BoxSpaceProvider (const BoxSpaceProvider &)=delete
 
BoxSpaceProvideroperator= (const BoxSpaceProvider &)=delete
 
 BoxSpaceProvider (BoxSpaceProvider &&)=delete
 
BoxSpaceProvideroperator= (BoxSpaceProvider &&)=delete
 
const BoxSpacegetSpace () const
 

Private Attributes

std::vector< ObservationModel * > parts
 

Detailed Description

Combines multiple ObservationModels into one by concatenating their observation vectors.

Definition at line 44 of file OMCombined.h.

Constructor & Destructor Documentation

◆ ~OMCombined()

Rcs::OMCombined::~OMCombined ( )
virtual

Definition at line 36 of file OMCombined.cpp.

Member Function Documentation

◆ addPart()

void Rcs::OMCombined::addPart ( ObservationModel part)

Add an ObservationModel as part of this combined model.

This must be done right after construction, before reset() is called for the first time.

OMCombined will assume ownership of the passed object.

Parameters
[in]partpart model to add

Definition at line 43 of file OMCombined.cpp.

◆ computeObservation()

void Rcs::OMCombined::computeObservation ( double *  state,
double *  velocity,
const MatNd *  currentAction,
double  dt 
) const
virtual

Implement to fill the observation vector with the observed values.

Parameters
[out]statestate observation vector to fill, has getStateDim() elements.
[out]velocityvelocity observation vector to fill, has getVelocityDim() elements.
[in]currentActionaction in current step. May be NULL if not available.
[in]dttime step since the last observation has been taken

Implements Rcs::ObservationModel.

Definition at line 68 of file OMCombined.cpp.

◆ getLimits()

void Rcs::OMCombined::getLimits ( double *  minState,
double *  maxState,
double *  maxVelocity 
) const
virtual

Provides the minimum and maximum observable values. Since the velocity is symmetric, only the maximum needs to be provided. The default implementation uses -inf and inf.

Parameters
[out]minStateminimum state vector to fill, has getStateDim() elements.
[out]maxStatemaximum state vector to fill, has getStateDim() elements.
[out]maxVelocitymaximum velocity vector to fill, has getVelocityDim() elements.

Reimplemented from Rcs::ObservationModel.

Definition at line 78 of file OMCombined.cpp.

◆ getNested()

std::vector< ObservationModel * > Rcs::OMCombined::getNested ( ) const
virtual

List directly nested observation models. The default implementation returns an empty list, since there are no nested models.

Reimplemented from Rcs::ObservationModel.

Definition at line 127 of file OMCombined.cpp.

◆ getStateDim()

unsigned int Rcs::OMCombined::getStateDim ( ) const
virtual

The number of state variables.

Implements Rcs::ObservationModel.

Definition at line 48 of file OMCombined.cpp.

◆ getStateNames()

std::vector< std::string > Rcs::OMCombined::getStateNames ( ) const
virtual

Provides names for each state entry.

Returns
a vector of name strings. Must be of length getStateDim() or empty for a nameless space.

Reimplemented from Rcs::ObservationModel.

Definition at line 91 of file OMCombined.cpp.

◆ getVelocityDim()

unsigned int Rcs::OMCombined::getVelocityDim ( ) const
virtual

The number of velocity variables. The default implementation assumes that for each state there is a velocity.

Reimplemented from Rcs::ObservationModel.

Definition at line 58 of file OMCombined.cpp.

◆ getVelocityNames()

std::vector< std::string > Rcs::OMCombined::getVelocityNames ( ) const
virtual

Provides names for each velocity entry. The default implementation derives the names from getStateNames(), appending a 'd' to each name.

Returns
a vector of name strings. Must be of length getVelocityDim() or empty for a nameless space.

Reimplemented from Rcs::ObservationModel.

Definition at line 105 of file OMCombined.cpp.

◆ reset()

void Rcs::OMCombined::reset ( )
virtual

Reset any internal state. This is called to begin a new episode. It should also reset values depending on modifiable physics parameters. This is an optional operation, so the default implementation does nothing.

Reimplemented from Rcs::ObservationModel.

Definition at line 119 of file OMCombined.cpp.

Member Data Documentation

◆ parts

std::vector<ObservationModel*> Rcs::OMCombined::parts
private

Definition at line 77 of file OMCombined.h.


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