Biorbd Release_1.13.0
Loading...
Searching...
No Matches
FatigueState.h
1#ifndef BIORBD_MUSCLES_FATIGUE_STATE_H
2#define BIORBD_MUSCLES_FATIGUE_STATE_H
3
4#include "biorbdConfig.h"
5
6#include <memory>
7
8#include "MusclesEnums.h"
9#include "Utils/Scalar.h"
10
11namespace BIORBD_NAMESPACE {
12namespace internal_forces {
13namespace muscles {
14
18class BIORBD_API FatigueState {
19 public:
27 const utils::Scalar& active = 1,
28 const utils::Scalar& fatigued = 0,
29 const utils::Scalar& resting = 0);
30
35 FatigueState(const FatigueState& other);
36
41 FatigueState(const std::shared_ptr<FatigueState> other);
42
46 virtual ~FatigueState();
47
52 FatigueState DeepCopy() const;
53
58 void DeepCopy(const FatigueState& other);
59
60#ifndef BIORBD_USE_CASADI_MATH
68 virtual void setState(
69 utils::Scalar active,
70 utils::Scalar fatigued,
71 utils::Scalar resting,
72 bool turnOffWarnings = false);
73#endif
74
79 const utils::Scalar& activeFibers() const;
80
85 const utils::Scalar& fatiguedFibers() const;
86
91 const utils::Scalar& restingFibers() const;
92
97 STATE_FATIGUE_TYPE getType() const;
98
99 protected:
100 std::shared_ptr<utils::Scalar>
102 std::shared_ptr<utils::Scalar>
104 std::shared_ptr<utils::Scalar>
106
110 virtual void setType();
111 std::shared_ptr<STATE_FATIGUE_TYPE>
113};
114
115} // namespace muscles
116} // namespace internal_forces
117} // namespace BIORBD_NAMESPACE
118
119#endif // BIORBD_MUSCLES_FATIGUE_STATE_H
STATE_FATIGUE_TYPE getType() const
Return the type of muscle fatigue model.
FatigueState DeepCopy() const
Deep copy of the fatigue state.
std::shared_ptr< STATE_FATIGUE_TYPE > m_type
Type of the muscle fatigue model.
std::shared_ptr< utils::Scalar > m_fatiguedFibers
Proportion of fatigued muscle fibers.
const utils::Scalar & fatiguedFibers() const
Return the propotion of fatigued muscle fibers.
std::shared_ptr< utils::Scalar > m_activeFibers
Proportion of active muscle fibers.
virtual void setState(utils::Scalar active, utils::Scalar fatigued, utils::Scalar resting, bool turnOffWarnings=false)
Safe set of the state (ensure that sum of all activation is 1).
const utils::Scalar & activeFibers() const
Return the propotion of active muscle fibers.
const utils::Scalar & restingFibers() const
Return the propotion of resting muscle fibers.
std::shared_ptr< utils::Scalar > m_restingFibers
Proportion of resting muscle fibers.
FatigueState(const utils::Scalar &active=1, const utils::Scalar &fatigued=0, const utils::Scalar &resting=0)
Construct fatigue state.