Class ostk::astrodynamics::EventCondition¶
- class EventCondition¶
An Event Condition defines a criterion that can be evaluated based on a current/previous state vectors and times.
Subclassed by ostk::astrodynamics::eventcondition::AngularCondition, ostk::astrodynamics::eventcondition::LogicalCondition, ostk::astrodynamics::eventcondition::RealCondition
Public Functions
- EventCondition(const String &aName, const std::function<Real(const State&)> &anEvaluator, const EventCondition::Target &aTarget)¶
Constructor.
EventCondition eventCondition = {aName, anEvaluator, aTarget};
- Parameters:
aName -- A string representing the name of the Real Event Condition
anEvaluator -- A function evaluating a state
aTarget -- A target associated with the Real Event Condition
- EventCondition(const String &aName, const std::function<Real(const State&)> &anEvaluator, const Real &aTargetValue)¶
Constructor.
EventCondition eventCondition = {aName, anEvaluator, aTargetValue};
- Parameters:
aName -- A string representing the name of the Real Event Condition
anEvaluator -- A function evaluating a state
aTargetValue -- A target value associated with the Real Event Condition
- virtual ~EventCondition()¶
Virtual destructor.
- String getName() const¶
Get the name of the Event Condition.
- Returns:
String representing the name of the Event Condition
- std::function<Real(const State&)> getEvaluator() const¶
Get evaluator.
- Returns:
Evaluator
- virtual void updateTarget(const State &aState)¶
Update the target value if the Event Condition is relative.
- Parameters:
aState -- A state to calculate the relative target from
- virtual void print(std::ostream &anOutputStream, bool displayDecorator = true) const¶
Print the Event Condition.
- Parameters:
anOutputStream -- [inout] The output stream where the Event Condition will be printed
displayDecorator -- A boolean indicating whether or not to display decorator during printing
- virtual EventCondition *clone() const = 0¶
Create a copy of this EventCondition.
- Returns:
Pointer to the cloned EventCondition
- virtual bool isSatisfied(const State ¤tState, const State &previousState) const = 0¶
Check if the Event Condition is satisfied based on current state and previous state/time.
- Parameters:
currentState -- The current state
previousState -- The previous state
- Returns:
Boolean value indicating if the Event Condition is met
Friends
- friend std::ostream &operator<<(std::ostream &anOutputStream, const EventCondition &anEventCondition)¶
Output stream operator.
std::cout << EventCondition(...);
- Parameters:
anOutputStream -- An output stream
anEventCondition -- An EventCondition
- Returns:
A reference to output stream
- EventCondition(const String &aName, const std::function<Real(const State&)> &anEvaluator, const EventCondition::Target &aTarget)¶