codac  1.5.7
codac_DataLoader.h
1 
11 #ifndef __CODAC_DATALOADER_H__
12 #define __CODAC_DATALOADER_H__
13 
14 #include <string>
15 #include <fstream>
16 #include "codac_TubeVector.h"
17 #include "codac_TrajectoryVector.h"
18 #include "codac_Beacon.h"
19 
20 namespace codac
21 {
22  class DataLoader
23  {
24  public:
25 
26  DataLoader();
27  DataLoader(const std::string& file_path);
28  ~DataLoader();
29 
30  void load_data(TubeVector *&x,
31  TrajectoryVector *&truth,
32  float timestep,
33  const Interval& tdomain = Interval::ALL_REALS);
34 
35  bool serialized_data_available() const;
36  void deserialize_data(TubeVector *&x, TrajectoryVector *&traj) const;
37  void serialize_data(const TubeVector& x, const TrajectoryVector& traj) const;
38 
39  static std::vector<Beacon> generate_landmarks(const IntervalVector& map_box, int nb_landmarks = 100);
40  static std::vector<IntervalVector> generate_landmarks_boxes(const IntervalVector& map_box, int nb_landmarks = 100);
41  static std::vector<IntervalVector> generate_observations(
42  const Vector& x,
43  const std::vector<Beacon>& map,
44  bool random = true,
45  const Interval& visi_range = Interval::POS_REALS,
46  const Interval& visi_angle = Interval::ALL_REALS);
47  static std::vector<IntervalVector> generate_observations(
48  const Vector& x,
49  const std::vector<IntervalVector>& map,
50  bool random = true,
51  const Interval& visi_range = Interval::POS_REALS,
52  const Interval& visi_angle = Interval::ALL_REALS);
53  static std::vector<IntervalVector> generate_observations(
54  const TrajectoryVector& x,
55  const std::vector<Beacon>& map,
56  int nb_obs = 50,
57  bool random = true,
58  const Interval& visi_range = Interval(0.,50.),
59  const Interval& visi_angle = Interval(-M_PI/4.,M_PI/4.),
60  const Interval& tdomain = Interval::ALL_REALS);
61  static std::vector<IntervalVector> generate_observations(
62  const TrajectoryVector& x,
63  const std::vector<IntervalVector>& map,
64  int nb_obs = 50,
65  bool random = true,
66  const Interval& visi_range = Interval(0.,50.),
67  const Interval& visi_angle = Interval(-M_PI/4.,M_PI/4.),
68  const Interval& tdomain = Interval::ALL_REALS);
69  static std::vector<IntervalVector> generate_static_observations(
70  const Vector& x,
71  const std::vector<IntervalVector>& map,
72  bool random = true,
73  const Interval& visi_range = Interval::POS_REALS,
74  const Interval& visi_angle = Interval::ALL_REALS);
75  static std::vector<IntervalVector> generate_observations_along_traj(
76  const TrajectoryVector& x,
77  const std::vector<IntervalVector>& map,
78  int nb_obs = 50,
79  bool random = true,
80  const Interval& visi_range = Interval(0.,50.),
81  const Interval& visi_angle = Interval(-M_PI/4.,M_PI/4.),
82  const Interval& tdomain = Interval::ALL_REALS);
83 
84  protected:
85 
86  std::string m_file_path;
87  std::ifstream *m_datafile = nullptr;
88  };
89 }
90 
91 #endif
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9