|
@@ -75,11 +75,12 @@ public:
|
|
|
if (_step == 0) {
|
|
|
observe(t);
|
|
|
} else {
|
|
|
- double time = std::ceil(t / _step) * _step;
|
|
|
+ double time = std::floor((t + epsilon) / _step) * _step;
|
|
|
|
|
|
- while (time < next_t) {
|
|
|
+ while (time < next_t and std::abs(time - next_t) > epsilon) {
|
|
|
observe(time);
|
|
|
time += _step;
|
|
|
+ time = std::floor((time + epsilon) / _step) * _step;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -99,6 +100,8 @@ private:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ const double epsilon = 1e-6;
|
|
|
+
|
|
|
double _step;
|
|
|
const common::Model<Time> *_model;
|
|
|
Views _views;
|