Implements a mechanism to group and loop computations, the computations will be called in sequence repeatedly until one of the exit criteria is met.
More...
#include <ComputationGroup.h>
Implements a mechanism to group and loop computations, the computations will be called in sequence repeatedly until one of the exit criteria is met.
That is either the endIteration() call, or shouldAbortLoop() in the
- See also
- PhysicsManagerState return true.
§ addComputation()
void SurgSim::Physics::ComputationGroup::addComputation |
( |
const std::shared_ptr< Computation > & |
computation | ) |
|
Adds a computation to this group, the computation will be appended at the end.
- Parameters
-
computation | the computation to be added to this group |
§ endIteration()
bool SurgSim::Physics::ComputationGroup::endIteration |
( |
| ) |
|
|
virtual |
Override this function to implement a custom criterion to exit this computation, when this returns true the computation will exit and return the last state.
- Note
- the computation can also be stopped by calling setAbortLoop(true) on the physics state by any calculation
- Returns
- true to stop calculating.
§ getComputations()
std::vector< std::shared_ptr< Computation > > SurgSim::Physics::ComputationGroup::getComputations |
( |
| ) |
const |
- Returns
- the computations used by this class
§ getIterations()
size_t SurgSim::Physics::ComputationGroup::getIterations |
( |
| ) |
|
- Returns
- the number of iterations that have passed
§ setComputations()
void SurgSim::Physics::ComputationGroup::setComputations |
( |
const std::vector< std::shared_ptr< Computation >> & |
val | ) |
|
- Parameters
-
val | set the computations used by this class |
The documentation for this class was generated from the following files: