Update.
[mtp.git] / tracker.cc
index f5dffd8..5a0647b 100644 (file)
@@ -186,8 +186,8 @@ void Tracker::track() {
 #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 " << p << " [length " << path->nb_nodes << "] " << path->nodes[0];
+    for(int n = 1; n < path->nb_nodes; n++) {
       cout << " -> " << path->nodes[n];
     }
     cout << endl;
@@ -199,12 +199,16 @@ int Tracker::nb_trajectories() {
   return _graph->nb_paths;
 }
 
+scalar_t Tracker::trajectory_score(int k) {
+  return -_graph->paths[k]->length;
+}
+
 int Tracker::trajectory_entrance_time(int k) {
   return (_graph->paths[k]->nodes[1] - 1) / (2 * _nb_locations);
 }
 
 int Tracker::trajectory_duration(int k) {
-  return (_graph->paths[k]->length - 2) / 2;
+  return (_graph->paths[k]->nb_nodes - 2) / 2;
 }
 
 int Tracker::trajectory_location(int k, int time) {