OpenSim Moco  0.4.0
Public Member Functions | Friends | List of all members
OpenSim::MocoConstraintInfo Class Reference

Description

Information for a given constraint in the optimal control problem.

The name should correspond to a MocoPathConstraint in the problem.

Inheritance diagram for OpenSim::MocoConstraintInfo:

#include <Moco/Moco/MocoConstraintInfo.h>

Public Member Functions

int getNumEquations () const
 
std::vector< MocoBoundsgetBounds () const
 Get the bounds on the scalar constraint equations. More...
 
std::vector< std::string > getSuffixes () const
 Get the suffixes for the scalar constraint equations. More...
 
void setBounds (const std::vector< MocoBounds > &bounds)
 
void setSuffixes (const std::vector< std::string > &suffixes)
 
std::vector< std::string > getConstraintLabels () const
 Get a list of constraint labels based on the constraint name and, if specified, the list of suffixes. More...
 
void printDescription (std::ostream &stream=std::cout) const
 Print the name, type, number of scalar equations, and bounds for this constraint. More...
 

Friends

class MocoPathConstraint
 
class MocoKinematicConstraint
 
class MocoGoal
 

Member Function Documentation

◆ getBounds()

std::vector<MocoBounds> OpenSim::MocoConstraintInfo::getBounds ( ) const
inline

Get the bounds on the scalar constraint equations.

If the number of equations have been set, but not the bounds, zero-bounds are returned as a default. If nothing has been set, this returns an empty vector.

Note: the return value is constructed fresh on every call from the internal property. Avoid repeated calls to this function.

◆ getConstraintLabels()

std::vector<std::string> OpenSim::MocoConstraintInfo::getConstraintLabels ( ) const

Get a list of constraint labels based on the constraint name and, if specified, the list of suffixes.

If no suffixes have been specified, zero-indexed, numeric suffixes will be applied as a default. The length of the returned vector is equal to the value returned by getNumEquations().

◆ getSuffixes()

std::vector<std::string> OpenSim::MocoConstraintInfo::getSuffixes ( ) const
inline

Get the suffixes for the scalar constraint equations.

If the suffixes have not been set, this returns an empty vector.

Note: the return value is constructed fresh on every call from the internal property. Avoid repeated calls to this function.

◆ printDescription()

void OpenSim::MocoConstraintInfo::printDescription ( std::ostream &  stream = std::cout) const

Print the name, type, number of scalar equations, and bounds for this constraint.

◆ setBounds()

void OpenSim::MocoConstraintInfo::setBounds ( const std::vector< MocoBounds > &  bounds)
inline

Note: if the number of equations has not been set, this updates the internal equation count variable. If the number of equations has been set and the vector passed is the incorrect size, an error is thrown.

◆ setSuffixes()

void OpenSim::MocoConstraintInfo::setSuffixes ( const std::vector< std::string > &  suffixes)
inline

Note: if the number of equations has not been set, this updates the internal equation count variable. If the number of equations has been set and the vector passed is the incorrect size, an error is thrown.


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