X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=mtp.cc;h=b80f63b76706c35f6971bfa26f2792270236c071;hb=5b85b5488da0952f823b2c2cfd3793669fc3ac95;hp=06247e6f1e6ac8c4759f9a0bbb90612851395bba;hpb=8946d0df4263aa20a670cedd5d61f9709b858fca;p=mtp.git diff --git a/mtp.cc b/mtp.cc index 06247e6..b80f63b 100644 --- a/mtp.cc +++ b/mtp.cc @@ -51,11 +51,11 @@ int main(int argc, char **argv) { int nb_locations = 6; int nb_time_steps = 10; - Tracker tracker(nb_time_steps, nb_locations); + Tracker *tracker = new Tracker(nb_time_steps, nb_locations); for(int l = 0; l < nb_locations; l++) { for(int k = 0; k < nb_locations; k++) { - tracker.set_allowed_motion(l, k, abs(l - k) <= 1); + tracker->set_allowed_motion(l, k, abs(l - k) <= 1); } } @@ -63,24 +63,26 @@ int main(int argc, char **argv) { cout << "* ROUND " << r << endl; for(int t = 0; t < nb_time_steps; t++) { for(int l = 0; l < nb_locations; l++) { - tracker.set_detection_score(t, l, + tracker->set_detection_score(t, l, (drand48() < 0.9 ? -1.0 : 1.0) + drand48() * 0.1 - 0.05); } - tracker.set_detection_score(t, 0, + tracker->set_detection_score(t, 0, (drand48() < 0.9 ? 1.0 : -1.0) + drand48() * 0.1 - 0.05); } - tracker.build_graph(); - tracker.track(); + tracker->build_graph(); + tracker->track(); - for(int t = 0; t < tracker.nb_trajectories(); t++) { + for(int t = 0; t < tracker->nb_trajectories(); t++) { cout << "TRAJECTORY " << t << " :"; - for(int u = 0; u < tracker.trajectory_duration(t); u++) { - cout << " " << tracker.trajectory_location(t, u); + for(int u = 0; u < tracker->trajectory_duration(t); u++) { + cout << " " << tracker->trajectory_location(t, u); } cout << endl; } } + delete tracker; + exit(EXIT_SUCCESS); }