X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=tracker.cc;h=5a0647b682a73630744b0247204056d678e39bca;hb=6afe91234d7807ce82b96a071087decb2f7aead3;hp=f5dffd88e521373036cd147060d6bf3353ccc6ac;hpb=7704ecb19140055b21e1012cd0d394f2a6db98eb;p=mtp.git diff --git a/tracker.cc b/tracker.cc index f5dffd8..5a0647b 100644 --- a/tracker.cc +++ b/tracker.cc @@ -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) {