| 629 | } |
| 630 | |
| 631 | void FactorGraph::setVariableInsideWindow(const string Name, const double TimeWindow, const double CurrentTime) |
| 632 | { |
| 633 | /** find end of the current state */ |
| 634 | double Timestamp; |
| 635 | bool TimestampExists = _StateData.getTimeLast(Name, Timestamp); |
| 636 | |
| 637 | /** estimate end */ |
| 638 | const double CutTime = CurrentTime - TimeWindow; |
| 639 | |
| 640 | /** loop over timestamps that are newer than CutTime */ |
| 641 | if (TimestampExists) |
| 642 | { |
| 643 | while ((Timestamp > CutTime) && TimestampExists) |
| 644 | { |
| 645 | setVariable(Name, Timestamp); |
| 646 | TimestampExists = _StateData.getTimePrev(Name, Timestamp, Timestamp); |
| 647 | } |
| 648 | } |
| 649 | else if (!_StateData.checkID(Name)) |
| 650 | { |
| 651 | PRINT_ERROR("State doesn't exist: ", Name); |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | void FactorGraph::setAllVariableInsideWindow(const double TimeWindow, const double CurrentTime) |
| 656 | { |
nothing calls this directly
no test coverage detected