- int front_size = 0, new_front_size;
- front[front_size++] = source;
- source->distance_from_source = 0;
-
- do {
- new_front_size = 0;
- iteration++;
- for(int f = 0; f < front_size; f++) {
- v = front[f];
- for(Edge *e = v->root_edge; e; e = e->next) {
- d = v->distance_from_source + e->work_length;
- tv = e->terminal_vertex;
- if(d < tv->distance_from_source) {
- tv->distance_from_source = d;
- tv->pred_vertex = v;
- tv->pred_edge = e;
- if(tv->iteration < iteration) {
- new_front[new_front_size++] = tv;
- tv->iteration = iteration;
- }
- }
- }
- }
-
- tmp_front = new_front;
- new_front = front;
- front = tmp_front;
-
- tmp_front_size = new_front_size;
- new_front_size = front_size;
- front_size = tmp_front_size;
- } while(front_size > 0);
-}
-
-void Graph::find_best_paths(int *result_edge_occupation) {
- Vertex **front = new Vertex *[nb_vertices];
- Vertex **new_front = new Vertex *[nb_vertices];
-
- scalar_t total_length;
-
- initialize_work_lengths();
-
- do {
- total_length = 0.0;
- find_shortest_path(front, new_front);
- update_work_length();
-
- // Do we reach the sink?
- if(sink->pred_edge) {
-
- // If yes, compute the length of the best path
- for(Vertex *v = sink; v->pred_edge; v = v->pred_vertex) {
- total_length += v->pred_edge->length;
- }
-
- // If that length is negative
- if(total_length < 0.0) {
- // Invert all the edges along the best path
- for(Vertex *v = sink; v->pred_edge; v = v->pred_vertex) {
- Edge *e = v->pred_edge;
- e->terminal_vertex = v->pred_vertex;
- e->occupied = 1 - e->occupied;
- e->length = - e->length;
- e->work_length = - e->work_length;
- v->pred_vertex->del_edge(e);
- v->add_edge(e);
- }
- }
+ // for(int t = 0; t < nb_time_steps; t++) {
+ // tracker->detection_score[t][nb_locations/2] = detection_score(1, score_noise, flip_noise);
+ // }
+
+ // Puts two target with the typical local minimum
+
+ int la, lb;
+ scalar_t sa, sb;
+ for(int t = 0; t < nb_time_steps; t++) {
+ // Target a moves from location 0 to the middle and comes back,
+ // and is strongly detected on the first half, target b moves from
+ // location nb_locations-1 to the middle and comes back, and is
+ // strongly detected on the second half
+ if(t < nb_time_steps/2) {
+ la = t;
+ lb = nb_locations - 1 - t;
+ sa = detection_score(10.0, -1.0, score_noise, flip_noise);
+ sb = detection_score( 1.0, -1.0, score_noise, flip_noise);
+ } else {
+ la = nb_time_steps - 1 - t;
+ lb = t - nb_time_steps + nb_locations;
+ sa = detection_score( 1.0, -1.0, score_noise, flip_noise);
+ sb = detection_score(10.0, -1.0, score_noise, flip_noise);