1 #ifndef COMMONSTATEEVALUATORS_H 2 #define COMMONSTATEEVALUATORS_H 25 return static_cast<double>(mVariable);
44 return static_cast<double>(mConst);
69 template <
typename Operator>
72 std::shared_ptr<StateEvaluator> mOp1, mOp2;
83 if (mOperator(mOp1->evaluate(
tstep, v), mOp2->evaluate(
tstep, v))) {
93 #endif // COMMONSTATEEVALUATORS_H
A decorator class that evaluates the relation between the values of two other evaluators.
Definition: commonstateevaluators.h:70
double evaluate(int, Vessel *) const
evaluate the state/variable, and returns the selected output, as double. Client can decide what to do...
Definition: commonstateevaluators.h:43
TwoArgumentsComparatorStateEvaluator(std::shared_ptr< StateEvaluator > op1, std::shared_ptr< StateEvaluator > op2, Operator oper)
Definition: commonstateevaluators.h:76
int tstep
Definition: main.cpp:205
An abstract class to allow internal/External states to be evaluated.
Definition: stateevaluator.h:14
double evaluate(int tstep, Vessel *v) const
Overridden method. Apply an operator (passed as template parameter) to two other evaluators.
Definition: commonstateevaluators.h:82
Definition: commonstateevaluators.h:8
VariableReferenceStateEvaluator(T &var)
Definition: commonstateevaluators.h:20
A templated class to evaluate a static variable.
Definition: commonstateevaluators.h:15
ConstStateEvaluator(const T &var)
Definition: commonstateevaluators.h:39
A templated class that evaluates constant-valued variable.
Definition: commonstateevaluators.h:35
double evaluate(int, Vessel *) const
evaluate the state/variable, and returns the selected output, as double. Client can decide what to do...
Definition: commonstateevaluators.h:24