Bayes Filters Library
PFPrediction.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2019 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This software may be modified and distributed under the terms of the
5  * BSD 3-Clause license. See the accompanying LICENSE file for details.
6  */
7 
9 
10 #include <exception>
11 #include <iostream>
12 
13 using namespace bfl;
14 using namespace Eigen;
15 
16 
17 void PFPrediction::predict(const ParticleSet& prev_particles, ParticleSet& pred_particles)
18 {
19  if (!skip_)
20  predictStep(prev_particles, pred_particles);
21  else
22  pred_particles = prev_particles;
23 }
24 
25 
26 bool PFPrediction::skip(const std::string& what_step, const bool status)
27 {
28  if (what_step == "prediction")
29  {
30  skip_ = status;
31 
32  getStateModel().skip("state", status);
33 
34  getStateModel().skip("exogenous", status);
35  }
36  else if (what_step == "state")
37  {
38  getStateModel().skip("state", status);
39 
40  skip_ = getStateModel().is_skipping() & getStateModel().exogenous_model().is_skipping();
41  }
42  else if (what_step == "exogenous")
43  {
44  getStateModel().skip("exogenous", status);
45 
46  skip_ = getStateModel().is_skipping() & getStateModel().exogenous_model().is_skipping();
47  }
48  else
49  return false;
50 
51  return true;
52 }
53 
54 
56 {
57  return skip_;
58 }
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
bfl::PFPrediction::is_skipping
bool is_skipping()
Definition: PFPrediction.cpp:55
PFPrediction.h
bfl::PFPrediction::skip
bool skip(const std::string &what_step, const bool status)
Definition: PFPrediction.cpp:26
bfl::ParticleSet
Definition: ParticleSet.h:20
bfl::PFPrediction::predict
void predict(const ParticleSet &prev_particles, ParticleSet &pred_particles)
Definition: PFPrediction.cpp:17