retrieve_paths seems to work!
[mtp.git] / tracker.cc
index 8490d6f..4b7375f 100644 (file)
@@ -55,6 +55,8 @@ void Tracker::set_detection_score(int time, int location, scalar_t score) {
 }
 
 void Tracker::build_graph() {
+
+  // Delete existing graph
   delete[] _edge_lengths;
   delete[] _graph;
   delete[] _edge_occupation;
@@ -137,8 +139,17 @@ void Tracker::track() {
   }
 
   _graph->find_best_paths(_edge_lengths, _edge_occupation);
+  _graph->retrieve_paths();
 
-  _graph->print_dot();
+  for(int p = 0; p < _graph->nb_paths; p++) {
+    Path *path = _graph->paths[p];
+    cout << "PATH " << p << " [length " << path->length << "] " << path->nodes[0];
+    for(int n = 1; n < path->length; n++) {
+      cout << " -> " << path->nodes[n];
+    }
+    cout << endl;
+  }
+  // _graph->print_dot();
 }
 
 // void Tracker::track() {