20 _dt = std::numeric_limits<real>::infinity();
21 _explanation = std::make_shared<std::string>(
"nothing");
25 : _success(success), _dt(dt), _explanation(explanation)
27 _constraint = std::make_shared<TimestepConstraint>();
32 std::shared_ptr<std::string> explanation,
33 std::shared_ptr<TimestepConstraint> constraint)
34 : _success(success), _dt(dt), _explanation(explanation), _constraint(constraint)
44 _dt = std::numeric_limits<real>::infinity();
45 _explanation = std::make_shared<std::string>(
"nothing");
83 return a._dt < b._dt ? a : b;
89 std::shared_ptr<std::string> _explanation;
90 std::shared_ptr<TimestepConstraint> _constraint;
Encapsulates information necessary to communicate and explain a decision about what timestep should b...
Definition: timestep_decision.h:16
void reset()
Resets everything to default values.
Definition: timestep_decision.h:41
real getDt() const
The timestep that was decided upon.
Definition: timestep_decision.h:56
std::shared_ptr< std::string > getExplanation() const
An explanation for why this timestep was chosen.
Definition: timestep_decision.h:72
TimestepDecision(bool success, real dt, std::shared_ptr< std::string > explanation, std::shared_ptr< TimestepConstraint > constraint)
Definition: timestep_decision.h:30
TimestepDecision()
Definition: timestep_decision.h:18
static const TimestepDecision & minDt(const TimestepDecision &a, const TimestepDecision &b)
Compare two TimestepDecisions and return the one with the smallest dt.
Definition: timestep_decision.h:80
TimestepDecision(bool success, real dt, std::shared_ptr< std::string > explanation)
Definition: timestep_decision.h:24
bool isSuccess() const
Definition: timestep_decision.h:48
std::shared_ptr< TimestepConstraint > getConstraint() const
The most restrictive TimestepConstraint that informed the decision.
Definition: timestep_decision.h:64
#define real
Definition: wmoclunstructuredreconstruction.h:11