]> mj.ucw.cz Git - leo.git/commitdiff
Labelling: Placements have indices
authorKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 21:46:25 +0000 (23:46 +0200)
committerKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 21:46:25 +0000 (23:46 +0200)
labeller.c
labeller.h

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
index f4cb2d357145c7cda40ba759c1b2ff707dbacef6..14905bb9d727c68ab0884aad7f947bc07f190fa7 100644 (file)
@@ -143,6 +143,7 @@ struct placement
   double x;
   double y;
   int variant_used;
+  int ind;
   bool processed;
   // FIXME: Replace with clist?
   struct placement_link *map_links;