-// void Tracker::track() {
- // int e = _nb_locations;
- // for(int t = 0; t <= _nb_time_steps; t++) {
- // for(int l = 0; l < _nb_locations; l++) {
- // edge_length[e] = _detection_score[t][l];
- // e++;
- // if(t == _nb_time_steps) {
- // e++;
- // } else {
- // e += _nb_locations;
- // }
- // }
- // }
-// }
+void Tracker::print_graph_dot(ostream *os) {
+ int e = 0;
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ _edge_lengths[e++] = - detection_score[t][l];
+ }
+ }
+ _graph->print_dot(os);
+}
+
+void Tracker::track() {
+ int e = 0;
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ _edge_lengths[e++] = - detection_score[t][l];
+ }
+ }
+
+ _graph->find_best_paths(_edge_lengths);
+ _graph->retrieve_disjoint_paths();
+
+#ifdef VERBOSE
+ 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;
+ }
+#endif
+}