Commit 157bfdb0 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

core: fix next time computation in kernel

Models can return too little time advance double therefore the sum `time
+ ta == time` with `time > 0.` can occured. Using std::nextafter fix the
problem.
parent dc644390
......@@ -5175,10 +5175,6 @@ struct abstract_cross
} else
compute_wake_up();
if (sigma > 0. && sigma + t == t) {
sigma = sigma * 10;
}
return status::success;
}
......@@ -6472,10 +6468,12 @@ public:
}
}
irt_assert(mdl.tn >= t);
mdl.tl = t;
mdl.tn = t + dyn.sigma;
assert(mdl.tn >= t);
if (dyn.sigma && mdl.tn == t)
mdl.tn = std::nextafter(t, t + 1.);
sched.reintegrate(mdl, mdl.tn);
......
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