OpenSim::ControlConstant Class Reference

#include <ControlConstant.h>

Inheritance diagram for OpenSim::ControlConstant:
OpenSim::Control OpenSim::Object

List of all members.

Public Member Functions

 ControlConstant (double aX=0.0, const char *aName="UNKOWN")
 Default constructor.
 ControlConstant (const ControlConstant &aControl)
 Copy constructor.
virtual ~ControlConstant ()
 Destructor.
virtual Objectcopy () const
 Construct a copy of this control.
ControlConstantoperator= (const ControlConstant &aControl)
 Assignment operator.
virtual int getNumParameters () const
 Get the number of parameters that are used to specify the control curve.
virtual void setParameterMin (int aI, double aMin)
 Set the minimum value of a control parameter.
virtual double getParameterMin (int aI) const
 Get the minimum value of a control parameter.
virtual void setParameterMax (int aI, double aMax)
 Set the maximum value of a control parameter.
virtual double getParameterMax (int aI) const
 Get the maximum value of a control parameter.
virtual double getParameterTime (int aI) const
 Get the time at which a parameter is specified.
virtual void getParameterNeighborhood (int aI, double &rTLower, double &rTUpper) const
 Get the time neighborhood (i.e., the lower and upper bounds of time) in which a control parameter affects the value of the control curve.
virtual int getParameterList (double aT, Array< int > &rList)
 Get the list of parameters that affect the control curve at a specified time.
virtual int getParameterList (double aT1, double aT2, Array< int > &rList)
 Get the list of parameters that affect the control curve between two specified times and that do NOT affect the control curve below the lower of these two times.
virtual void setParameterValue (int aI, double aP)
 Set the value of a control parameter.
virtual double getParameterValue (int aI) const
 Get the value of a control parameter.
virtual void setControlValue (double aT, double aX)
 Set the value of this control at time aT.
virtual double getControlValue (double aT)
 Get the value of this control at time aT.
virtual double getControlValueMin (double aT=0.0)
 Get the minimum allowed value of this control at time aT.
virtual void setControlValueMin (double aT, double aX)
 Set the minimum allowed value of this control at time aT.
virtual double getControlValueMax (double aT=0.0)
 Get the maxium allowed value of this control at time aT.
virtual void setControlValueMax (double aT, double aX)
 Set the maximum allowed value of this control at time aT.
 OPENSIM_DECLARE_DERIVED (ControlConstant, Control)

Protected Member Functions

void setupProperties ()
 Connect properties to local pointers.

Protected Attributes

PropertyDbl _propX
 Control value.
double & _x

Constructor & Destructor Documentation

ControlConstant::ControlConstant ( double  aX = 0.0,
const char *  aName = "UNKOWN" 
)

Default constructor.

Parameters:
aX Value of the control. By default, the control is assigned a value of 0.0.
aName Name of the control. By default, the control is given the name "UNKNOWN".
ControlConstant::ControlConstant ( const ControlConstant aControl  ) 

Copy constructor.

Parameters:
aControl Control to copy.
ControlConstant::~ControlConstant (  )  [virtual]

Destructor.


Member Function Documentation

Object * ControlConstant::copy (  )  const [virtual]

Construct a copy of this control.

Reimplemented from OpenSim::Object.

double ControlConstant::getControlValue ( double  aT  )  [virtual]

Get the value of this control at time aT.

Parameters:
aT Time at which to get the control.
Returns:
Control value. For ControlConstant, aT is not used since the control has a constant, time-independent value.

Implements OpenSim::Control.

double ControlConstant::getControlValueMax ( double  aT = 0.0  )  [virtual]

Get the maxium allowed value of this control at time aT.

Parameters:
aT Time.
Returns:
Maximum control value.

Implements OpenSim::Control.

double ControlConstant::getControlValueMin ( double  aT = 0.0  )  [virtual]

Get the minimum allowed value of this control at time aT.

Parameters:
aT Time.
Returns:
Minimum control value.

Implements OpenSim::Control.

int ControlConstant::getNumParameters (  )  const [virtual]

Get the number of parameters that are used to specify the control curve.

Returns:
Number of parameters.

Implements OpenSim::Control.

int ControlConstant::getParameterList ( double  aTLower,
double  aTUpper,
Array< int > &  rList 
) [virtual]

Get the list of parameters that affect the control curve between two specified times and that do NOT affect the control curve below the lower of these two times.

This method is useful when solving for a set of controls for a dynamic simulation. When solving for a set of controls, one always wants to go forward in time. Therefore, one does not want to change control parameters that affect the control curve at past times.

A control parameter is included in the list only if it affects the control curve in the specified time interval AND does NOT affect the control curve below the lower bound of the specified time interval. So, it is possible that some of the parameters on the returned list could affect the control curve at times greater than the upper bound of the specified time interval.

Parameters:
aTLower Lower time bound. The control curve is guarranteed not to be affected below this time by any of the returned parameters.
aTUpper Upper time bound. The control curve is NOT guarranteed to not be affected for times greater than this time.
rList List of control parameters that affect the curve at time aT. For ControlConstant, parameter 0 (i.e., the value of the constant) should be the only paramter on the list.
Returns:
Number of parameters in the list. For ControlConstant, 1 should always be returned.

Implements OpenSim::Control.

int ControlConstant::getParameterList ( double  aT,
Array< int > &  rList 
) [virtual]

Get the list of parameters that affect the control curve at a specified time.

Parameters:
aT Time in question.
rList List of control parameters that affect the curve at time aT. For ControlConstant, parameter 0 (i.e., the value of the constant) should be the only paramter on the list.
Returns:
Number of parameters in the list. For ControlConstant, 1 should always be returned.

Implements OpenSim::Control.

double ControlConstant::getParameterMax ( int  aI  )  const [virtual]

Get the maximum value of a control parameter.

Parameters:
aI Index of the parameter.
Returns:
Maximum value of the parameter.

Implements OpenSim::Control.

double ControlConstant::getParameterMin ( int  aI  )  const [virtual]

Get the minimum value of a control parameter.

Parameters:
aI Index of the parameter.
Returns:
Minimum value of the parameter.

Implements OpenSim::Control.

void ControlConstant::getParameterNeighborhood ( int  aI,
double &  rTLower,
double &  rTUpper 
) const [virtual]

Get the time neighborhood (i.e., the lower and upper bounds of time) in which a control parameter affects the value of the control curve.

Changes in the specified parameter are guarranteed not to change the value of the control curve below the lower bound time or above the upper bound time. If a parameter influences the value of the control curve for all times, -SimTKInfinity and SimTK::Infinity are returned for the upper and lower bound times, respectively.

Parameters:
aI Index of the parameter.
aTLower Time below which the curve is not affected the specified parameter. For ControlConstant, -SimTKInfinity is always returned.
aTUpper Time above which the curve is not affected the specified parameter. For ControlConstant, SimTK::Infinity is always returned.

Implements OpenSim::Control.

double ControlConstant::getParameterTime ( int  aI  )  const [virtual]

Get the time at which a parameter is specified.

Parameters for some types of control curves do not have a time at which they are specified. For example, in a Fourier series the control parameters are the cooefficients in the expansion, and each term in the expansion corresponds not to a specific time but to a frequency. Another example is a constant that has the same value for all times. In these cases, this method returns SimTK::NaN.

Parameters:
aI Index of the parameter.
Returns:
Time at which the control parameter occurs. For ControlConstant this value is not defined, and so SimTK::getNan() is always returned.

Implements OpenSim::Control.

double ControlConstant::getParameterValue ( int  aI  )  const [virtual]

Get the value of a control parameter.

Class ControlConstant has only 1 parameter, which is the value of the control.

Index Parameter
0 Control value

Parameters:
aI Index of the parameter (only 0 is valid in this case).
Returns:
Value of the parameter (value of the control in this case).

Implements OpenSim::Control.

OpenSim::ControlConstant::OPENSIM_DECLARE_DERIVED ( ControlConstant  ,
Control   
)
ControlConstant & ControlConstant::operator= ( const ControlConstant aControl  ) 

Assignment operator.

Returns:
Reference to the altered object.

Reimplemented from OpenSim::Control.

void ControlConstant::setControlValue ( double  aT,
double  aX 
) [virtual]

Set the value of this control at time aT.

Parameters:
aT Time at which to set the control.
aX Control value.

Implements OpenSim::Control.

void ControlConstant::setControlValueMax ( double  aT,
double  aMax 
) [virtual]

Set the maximum allowed value of this control at time aT.

Parameters:
aT Time.
aMax Maximum control value.

Implements OpenSim::Control.

void ControlConstant::setControlValueMin ( double  aT,
double  aMin 
) [virtual]

Set the minimum allowed value of this control at time aT.

Parameters:
aT Time.
aMin Minimum control value.

Implements OpenSim::Control.

void ControlConstant::setParameterMax ( int  aI,
double  aMax 
) [virtual]

Set the maximum value of a control parameter.

Parameters:
aI Index of the parameter.
aMax Maximum value of the parameter.

Implements OpenSim::Control.

void ControlConstant::setParameterMin ( int  aI,
double  aMin 
) [virtual]

Set the minimum value of a control parameter.

Parameters:
aI Index of the parameter.
aMin Minimum value of the parameter.

Implements OpenSim::Control.

void ControlConstant::setParameterValue ( int  aI,
double  aX 
) [virtual]

Set the value of a control parameter.

Class ControlConstant has only 1 parameter, which is the value of the control.

Index Parameter
0 Control value

Parameters:
aI Index of the parameter (only 0 is valid for ControlConstant).
aX Value of the parameter (value of the control for ControlConstant).
See also:
getNumParameters()

Implements OpenSim::Control.

void ControlConstant::setupProperties ( void   )  [protected, virtual]

Connect properties to local pointers.

Reimplemented from OpenSim::Control.


Member Data Documentation

Control value.

double& OpenSim::ControlConstant::_x [protected]

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

Generated on Wed Dec 16 15:03:43 2009 for OpenSim by  doxygen 1.6.1