]> mj.ucw.cz Git - leo.git/blobdiff - labeller.c
Labelling: Placements have indices
[leo.git] / labeller.c
index a3de345c95bbc113ab98ed6fcd1853ae26a40b3d..25fd5c81a82e40b20eea46ab32dd42e5c0318c44 100644 (file)
@@ -103,6 +103,7 @@ int move_min = 0;
 int move_max = 1;
 
 int num_requests = 0;
+int num_placements = 0;
 
 int conf_map_part_width = 5;
 int conf_map_part_height = 5;
@@ -1124,6 +1125,7 @@ void make_population(void)
 {
   for (int i=0; i<conf_pop_size; i++)
   {
+    num_placements = 0; // FIXME: This IS a terrible HACK
     struct individual *i2 = ep_alloc(ep_individuals);
     init_individual(i2);
     population2[i] = i2;
@@ -1719,6 +1721,7 @@ void hide_segment_labels(struct individual *individual)
 void init_placement(struct placement *p, struct individual *individual, struct request *r)
 {
   // FIXME
+  p->ind = num_placements++;
   p->request = r;
   p->processed = 0;
   p->x = p->y = 0; // To prevent valgrind from complaining