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

rdControlConstant Class Reference

A class that represents a constant control curve. More...

#include <rdControlConstant.h>

Inheritance diagram for rdControlConstant:

rdControl rdObject List of all members.

Public Member Functions

 rdControlConstant (double aX=0.0, const char *aName="UNKOWN")
 Default constructor.

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

 rdControlConstant (const rdControlConstant &aControl)
 Copy constructor.

virtual ~rdControlConstant ()
 Destructor.

virtual rdControlcopy () const
 Construct a copy of this control.

virtual rdControlcopy (IDOM_Element *aElement) const
 Copy this control and modify the copy so that it is consistent with a specified XML element node.

rdControlConstant & operator= (const rdControlConstant &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, rdArray< int > &rList) const
 Get the list of parameters that affect the control curve at a specified time.

virtual int getParameterList (double aT1, double aT2, rdArray< int > &rList) const
 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) const
 Get the value of this control at time aT.

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 PROP_X [] = "value"

Protected Attributes

double _x
 Control value.


Private Member Functions

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

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


Detailed Description

A class that represents a constant control curve.

That is, the value of the control curve is the same at any value of time.

Author:
Frank C. Anderson
Version:
1.0


Constructor & Destructor Documentation

rdControlConstant::rdControlConstant 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".

rdControlConstant::rdControlConstant IDOM_Element *  aElement  ) 
 

Construct a control from an XML Element.

Parameters:
aElement XML element.

rdControlConstant::rdControlConstant const rdControlConstant &  aControl  ) 
 

Copy constructor.

Parameters:
aControl Control to copy.


Member Function Documentation

rdControl * rdControlConstant::copy IDOM_Element *  aElement  )  const [virtual]
 

Copy this control and modify the copy so that it is consistent with a specified XML element node.

The copy is constructed by first using the contructor for the IDOM_Element in order to establish the relationship of the control with the XML node. Then, the assignment operator is used to set all member variables of the copy to the values of this object. Finally, the data members of the copy are updated from the IDOM_Elment using updateObject().

Parameters:
aElement XML element.
Returns:
Pointer to a copy of this actuator.

Implements rdControl.

void rdControlConstant::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 rdControl.

double rdControlConstant::getControlValue double  aT  )  const [virtual]
 

Get the value of this control at time aT.

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

Implements rdControl.

int rdControlConstant::getNumParameters  )  const [virtual]
 

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

Returns:
Number of parameters.

Implements rdControl.

int rdControlConstant::getParameterList double  aT1,
double  aT2,
rdArray< int > &  rList
const [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 rdControlConstant, 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 rdControlConstant, 1 should always be returned.

Implements rdControl.

int rdControlConstant::getParameterList double  aT,
rdArray< int > &  rList
const [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 rdControlConstant, 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 rdControlConstant, 1 should always be returned.

Implements rdControl.

double rdControlConstant::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 rdControl.

double rdControlConstant::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 rdControl.

void rdControlConstant::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, rdMath::MINUS_INFINITY and rdMath::PLUS_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 rdControlConstant, rdMath::MINUS_INFINITY is always returned.
aTUpper Time above which the curve is not affected the specified parameter. For rdControlConstant, rdMath::PLUS_INFINITY is always returned.

Implements rdControl.

double rdControlConstant::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 rdMath::NAN.

Parameters:
aI Index of the parameter.
Returns:
Time at which the control parameter occurs. For rdControlConstant this value is not defined, and so rdMath::NAN is always returned.

Implements rdControl.

double rdControlConstant::getParameterValue int  aI  )  const [virtual]
 

Get the value of a control parameter.

Class rdControlConstant 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 rdControl.

rdControlConstant & rdControlConstant::operator= const rdControlConstant &  aControl  ) 
 

Assignment operator.

Returns:
Reference to the altered object.

void rdControlConstant::setControlValue double  aT,
double  aX
[virtual]
 

Set the value of this control at time aT.

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

Implements rdControl.

void rdControlConstant::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 rdControl.

void rdControlConstant::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 rdControl.

void rdControlConstant::setParameterValue int  aI,
double  aP
[virtual]
 

Set the value of a control parameter.

Class rdControlConstant 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 rdControlConstant).
aX Value of the parameter (value of the control for rdControlConstant).
See also:
getNumParameters()

Implements rdControl.

void rdControlConstant::updateData  ) 
 

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

Member objects (children) are not updated.

Reimplemented from rdControl.

void rdControlConstant::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 rdControl.

void rdControlConstant::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 rdControl.


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