+ detection_scores[t][l] = 0.0;
+ }
+ }
+
+ _edge_lengths = 0;
+ _graph = 0;
+}
+
+void Tracker::write(ostream *os) {
+ (*os) << _nb_locations << " " << _nb_time_steps <<endl;
+
+ (*os) << endl;
+
+ for(int l = 0; l < _nb_locations; l++) {
+ for(int m = 0; m < _nb_locations; m++) {
+ (*os) << allowed_motion[l][m];
+ if(m < _nb_locations - 1) (*os) << " "; else (*os) << endl;
+ }
+ }
+
+ (*os) << endl;
+
+ for(int l = 0; l < _nb_locations; l++) {
+ (*os) << entrances[l];
+ if(l < _nb_locations - 1) (*os) << " "; else (*os) << endl;
+ }
+
+ (*os) << endl;
+
+ for(int l = 0; l < _nb_locations; l++) {
+ (*os) << exits[l];
+ if(l < _nb_locations - 1) (*os) << " "; else (*os) << endl;
+ }
+
+ (*os) << endl;
+
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ (*os) << detection_scores[t][l];
+ if(l < _nb_locations - 1) (*os) << " "; else (*os) << endl;
+ }
+ }
+}
+
+void Tracker::read(istream *is) {
+ int nb_locations, nb_time_steps;
+
+ (*is) >> nb_locations >> nb_time_steps;
+
+ allocate(nb_time_steps, nb_locations);
+
+ for(int l = 0; l < _nb_locations; l++) {
+ for(int m = 0; m < _nb_locations; m++) {
+ (*is) >> allowed_motion[l][m];
+ }
+ }
+
+ for(int l = 0; l < _nb_locations; l++) {
+ (*is) >> entrances[l];
+ }
+
+ for(int l = 0; l < _nb_locations; l++) {
+ (*is) >> exits[l];
+ }
+
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ (*is) >> detection_scores[t][l];