Commit b8ec7895 authored by K-H-Ismail's avatar K-H-Ismail Committed by Gauthier Quesnel
Browse files

core: repair cross and reset in integrator

parent 2ae164de
...@@ -3299,7 +3299,18 @@ struct integrator ...@@ -3299,7 +3299,18 @@ struct integrator
val += (t - archive.back().date) * archive.back().x_dot; val += (t - archive.back().date) * archive.back().x_dot;
return (up_threshold < val ) ? reset_value : val; if(up_threshold < val)
{
return reset_value;
}
else if (down_threshold > val)
{
return down_threshold;
}
else
{
return val;
}
} }
double compute_expected_value() const noexcept double compute_expected_value() const noexcept
...@@ -4697,12 +4708,11 @@ struct cross ...@@ -4697,12 +4708,11 @@ struct cross
} }
if (have_message_value) { if (have_message_value) {
event = 0.0;
if (value >= threshold) { if (value >= threshold) {
else_value = if_value; else_value = if_value;
event = 1.0; event = 1.0;
} else { }
event = 0.0;
}
} }
result = else_value; result = else_value;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment