Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdControl Class Reference

A class that represents a control in a dynamic simulation. More...

#include <rdControl.h>

Inheritance diagram for rdControl:

rdObject rdControlConstant rdControlLinear List of all members.

Public Member Functions

 rdControl (const char *aName="UNKOWN")
 Default constructor.

 rdControl (IDOM_Element *aElement)
 Construct a control from an XML Element.

 rdControl (const rdControl &aControl)
 Copy constructor.

virtual ~rdControl ()
 Destructor.

virtual rdControl * copy () const=0
virtual rdControl * copy (IDOM_Element *aElement) const=0
rdControl & operator= (const rdControl &aControl)
 Assignment operator.

void setIsModelControl (bool aTrueFalse)
 Set whether or not this control is a model control.

bool getIsModelControl () const
 Get whether or not this control is a model control.

virtual int getNumParameters () const=0
void setDefaultParameterMin (double aMin)
 Set the default minimum value of a control parameter.

double getDefaultParameterMin () const
 Get the default minimum value of a control parameter.

void setDefaultParameterMax (double aMin)
 Set the default maximum value of a control parameter.

double getDefaultParameterMax () const
 Get the default maximum value of a control parameter.

virtual void setParameterMin (int aI, double aMin)=0
virtual double getParameterMin (int aI) const=0
virtual void setParameterMax (int aI, double aMax)=0
virtual double getParameterMax (int aI) const=0
virtual double getParameterTime (int aI) const=0
virtual void getParameterNeighborhood (int aI, double &rTLower, double &rTUpper) const=0
virtual int getParameterList (double aT, rdArray< int > &rList) const=0
virtual int getParameterList (double aTLower, double aTUpper, rdArray< int > &rList) const=0
virtual double getParameterValue (int aI) const=0
virtual void setParameterValue (int aI, double aP)=0
virtual double getControlValue (double aT=0.0) const=0
virtual void setControlValue (double aT, double aX)=0
virtual void updateObject (bool aDeep=true)
 Update this object based on its XML node.

void updateData ()
 Update the member data of this object based on its XML node.

virtual void updateNode (bool aDeep=true)
 Update the XML node representing this object.

virtual void generateNode (IDOM_Element *aParent)
 Generate an XML node representing this object.


Static Public Attributes

const char DEFAULT_NAME [] = "default"
const char PROP_IS_MODEL_CONTROL [] = "is_model_control"
const char PROP_DEFAULT_MIN [] = "default_minimum"
const char PROP_DEFAULT_MAX [] = "default_maximum"

Protected Attributes

bool _isModelControl
 Flag that specifies whether or not this control is a model control.

double _defaultMin
 Default parameter minimum.

double _defaultMax
 Default parameter maximum.


Private Member Functions

void setNull ()
 Set the member variables to their NULL values.

void copyData (const rdControl &aControl)
 Copy the member variables of the specified control.


Detailed Description

A class that represents a control in a dynamic simulation.

This class is intended to be the base class for different types of controls, so many of its methods are virtual.

In general, a control consists of a set of parameters. These parameters are used to reconstruct a control curve. For example, a control may be represented by a consant, a series of step functions, a set of linearly interpolated values, a set of spline control points, coefficients in a Fourier series, etc.

Because there is not necessarily a 1-to-1 correspondence between the parameters used to represent a control curve and the value of the control curve, there are two basic ways to access the content of a control: getParameter() gets the value of a parameter, and getValue() gets the value at a particular time.

A distinction is also made between controls that control a model and controls that control some other aspect of a simulation. For example, a control for the excitation level of a muscle is a "model" control. The value of this type of control is querried during the course of a simualtion. On the other hand, a control for the final time of a simulation is not usually a "model" control. Nor is a control for the initial value of a state variable, even if that state variable is the initial value of a muscle activation. These "non-model" controls are used to set things before a simulation ever begins and are not querried during the cours of a simulation. The number of model controls can be querried by a call to rdModel::getNX().

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

rdControl::rdControl IDOM_Element *  aElement  ) 
 

Construct a control from an XML Element.

Parameters:
aElement XML element.

rdControl::rdControl const rdControl &  aControl  ) 
 

Copy constructor.

Parameters:
aControl Control to copy.


Member Function Documentation

void rdControl::generateNode IDOM_Element *  aParent  )  [virtual]
 

Generate an XML node representing this object.

Parameters:
aParent Intended parent of the node to be generated. If aParent is NULL, the intent is for this object to serve as the root element of a new document.
See also:
rdObject::generateNode()

Reimplemented from rdObject.

Reimplemented in rdControlConstant, and rdControlLinear.

double rdControl::getDefaultParameterMax  )  const
 

Get the default maximum value of a control parameter.

The default maximum is used when no maximum value is specified.

Returns:
Maximum value.

double rdControl::getDefaultParameterMin  )  const
 

Get the default minimum value of a control parameter.

The default minimum is used when no minimum value is specified.

Returns:
Minimum value.

bool rdControl::getIsModelControl  )  const
 

Get whether or not this control is a model control.

A model control is a control that is expected by a model. The number of model controls is returned by a call to rdModel::getNX(). Controls that are not model controls may be, for example, controls that are used to set up a simulation. Such examples might include an initial state of a model (e.g., joint angle, joint angular velocity, ...) or the final time of a siimulation.

Returns:
True if this control is a model control, false otherwise.

rdControl & rdControl::operator= const rdControl &  aControl  ) 
 

Assignment operator.

Returns:
Reference to the altered object.

void rdControl::setDefaultParameterMax double  aMin  ) 
 

Set the default maximum value of a control parameter.

The default maximum is used when no maximum value is specified.

Parameters:
aMax Maximum value.

void rdControl::setDefaultParameterMin double  aMin  ) 
 

Set the default minimum value of a control parameter.

The default minimum is used when no minimum value is specified.

Parameters:
aMin Minimum value.

void rdControl::setIsModelControl bool  aTrueFalse  ) 
 

Set whether or not this control is a model control.

A model control is a control that is expected by a model. The number of model controls is returned by a call to rdModel::getNX(). Controls that are not model controls may be, for example, controls that are used to set up a simulation. Such examples might include an initial state of a model (e.g., joint angle, joint angular velocity, ...) or the final time of a siimulation.

Parameters:
aTrueFalse If true, the control is treated as a model control. If false, the control is not treated as a model control.
See also:
rdModel::getNX()

void rdControl::updateData  ) 
 

Update the member data of this object based on its XML node.

Member objects (children) are not updated.

Reimplemented in rdControlConstant, and rdControlLinear.

void rdControl::updateNode bool  aDeep = true  )  [virtual]
 

Update the XML node representing this object.

Parameters:
aDeep If true, update the XML node of this object AND the XML nodes of all class members that are rdObjects (child nodes); if false, update only the XML node of this object without updating the XML nodes of its children.

Reimplemented from rdObject.

Reimplemented in rdControlConstant, and rdControlLinear.

void rdControl::updateObject bool  aDeep = true  )  [virtual]
 

Update this object based on its XML node.

Parameters:
aDeep If true, update this object and all its child objects (that is, member variables that are rdObject's); if false, update only the member variables that are not rdObject's.

Reimplemented from rdObject.

Reimplemented in rdControlConstant, and rdControlLinear.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:09 2003 for Simulation Software by doxygen1.3