OpenSim::ForceSet Class Reference

A class for holding and managing a set of actuators for a model. More...

#include <ForceSet.h>

Inheritance diagram for OpenSim::ForceSet:
OpenSim::ModelComponentSet< Force > OpenSim::Set< Force > OpenSim::Object

List of all members.

Public Member Functions

 ForceSet ()
 Default constructor.
 ForceSet (Model &model)
 ForceSet (Model &model, const std::string &aFileName, bool aUpdateFromXMLNode=true)
 Construct an actuator set from file.
 ForceSet (const ForceSet &aForceSet)
 Copy constructor.
virtual ~ForceSet ()
 Destructor.
virtual Objectcopy () const
 Copy this ForceSet and return a pointer to the copy.
void copyData (const ForceSet &aAbsForceSet)
 Copy the member variables of the ForceSet.
ForceSetoperator= (const ForceSet &aSet)
 Assignment operator.
void setup (Model &aModel)
void postInit (Model &aModel)
bool remove (int aIndex)
 Remove an actuator from the actuator set.
bool append (Force *aForce)
 Append an actuator on to the set.
bool append (ForceSet &aForceSet, bool aAllowDuplicateNames=false)
 Append actuators from an actuator set to this set.
bool set (int aIndex, Force *aForce)
 Set the actuator at an index.
bool insert (int aIndex, Force *aObject)
 Adding an object to the set causes its Model field to be set.
const Set< Actuator > & getActuators () const
 Get the list of Actuators.
Set< Actuator > & updActuators ()
void getStateVariableNames (Array< std::string > &rNames) const
 Get the names of the states of the actuators.
void computeEquilibrium (SimTK::State &s)
 Compute a set of equlibirium states.
void computeStateDerivatives (const SimTK::State &s)
 Compute the time derivatives of the states that characterize the actuators.
bool check () const
 Check that all actuators are valid.

Protected Attributes

Set< Actuator_actuators
 The subset of Forces that extend Actuator.

Detailed Description

A class for holding and managing a set of actuators for a model.

This class is based on ForceSet

Authors:
Jack Middleton
Version:
1.0

Constructor & Destructor Documentation

ForceSet::ForceSet (  ) 

Default constructor.

ForceSet::ForceSet ( Model model  ) 
ForceSet::ForceSet ( Model model,
const std::string &  aFileName,
bool  aUpdateFromXMLNode = true 
)

Construct an actuator set from file.

Parameters:
aFileName Name of the file.
ForceSet::ForceSet ( const ForceSet aForceSet  ) 

Copy constructor.

Parameters:
aForceSet ForceSet to be copied.
ForceSet::~ForceSet (  )  [virtual]

Destructor.


Member Function Documentation

bool ForceSet::append ( ForceSet aForceSet,
bool  aAllowDuplicateNames = false 
)

Append actuators from an actuator set to this set.

Copies of the actuators are not made.

This method overrides the method in Set<Force> so that several internal variables of the actuator set can be updated.

Parameters:
aForceSet The set of actuators to be appended.
aAllowDuplicateNames If true, all actuators will be appended; If false, don't append actuators whose name already exists in this model's actuator set.
Returns:
True if successful; false otherwise.
bool ForceSet::append ( Force aActuator  )  [virtual]

Append an actuator on to the set.

A copy of the specified actuator is not made.

This method overrides the method in Set<Force> so that several internal variables of the actuator set can be updated.

Parameters:
aActuator Pointer to the actuator to be appended.
Returns:
True if successful; false otherwise.

Reimplemented from OpenSim::ModelComponentSet< Force >.

bool ForceSet::check (  )  const

Check that all actuators are valid.

void ForceSet::computeEquilibrium ( SimTK::State &  s  ) 

Compute a set of equlibirium states.

Based on each actuator's curent set of states, each actuator alters those states to satisfy some notion of equilibrium. Each actuator is in charge of what it considers to be equilibirum. For example, given a muscle activation, compute muscle fiber length that is consistent with that activation level.

void ForceSet::computeStateDerivatives ( const SimTK::State &  s  ) 

Compute the time derivatives of the states that characterize the actuators.

Parameters:
rDY Array of state derivatives.
Object * ForceSet::copy (  )  const [virtual]

Copy this ForceSet and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this ForceSet.

Reimplemented from OpenSim::ModelComponentSet< Force >.

void ForceSet::copyData ( const ForceSet aAbsForceSet  ) 

Copy the member variables of the ForceSet.

Parameters:
aAbsForceSet actuator set to be copied
const Set< Actuator > & ForceSet::getActuators (  )  const

Get the list of Actuators.

void ForceSet::getStateVariableNames ( Array< std::string > &  rNames  )  const

Get the names of the states of the actuators.

Parameters:
rNames Array of names.
bool ForceSet::insert ( int  aIndex,
Force aObject 
) [virtual]

Adding an object to the set causes its Model field to be set.

Reimplemented from OpenSim::ModelComponentSet< Force >.

ForceSet & ForceSet::operator= ( const ForceSet aAbsForceSet  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

void ForceSet::postInit ( Model aModel  ) 
bool ForceSet::remove ( int  aIndex  )  [virtual]

Remove an actuator from the actuator set.

Parameters:
aIndex Index of the actuator to be removed.
Returns:
True if the remove was successful; false otherwise.

Reimplemented from OpenSim::Set< Force >.

bool ForceSet::set ( int  aIndex,
Force aActuator 
)

Set the actuator at an index.

A copy of the specified actuator is NOT made. The actuator previously set a the index is removed (and deleted).

This method overrides the method in Set<Force> so that several internal variables of the actuator set can be updated.

Parameters:
aIndex Array index where the actuator is to be stored. aIndex should be in the range 0 <= aIndex <= getSize();
aActuator Pointer to the actuator to be set.
Returns:
True if successful; false otherwise.
void ForceSet::setup ( Model aModel  ) 
Set< Actuator > & ForceSet::updActuators (  ) 

Member Data Documentation

The subset of Forces that extend Actuator.


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

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