]> mj.ucw.cz Git - leo.git/commitdiff
Labelling: Basic ranking
authorKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 09:46:09 +0000 (11:46 +0200)
committerKarryanna <karry@karryanna.cz>
Wed, 13 May 2015 09:46:09 +0000 (11:46 +0200)
labeller.c

index 3ccb6a1146f847ee8c4f745769832a93ced4d232..b7b8ee4cdbc43d58d2b1b859bc0a033f2b687504 100644 (file)
@@ -50,6 +50,7 @@ int dbg_map_parts = 0;
 int dbg_movement = 0;
 int dbg_init = 0;
 int dbg_overlaps = 0;
+int dbg_rank = 0;
 
 int page_width_int;
 int page_height_int;
@@ -1349,7 +1350,19 @@ int individual_overlap(struct individual *individual)
 
 void rank_population(void)
 {
-  // FIXME
+  int penalty;
+
+  for (int i=0; i<conf_pop_size; i++)
+  {
+    if (dbg_rank)
+      printf("Individual %d\n", i);
+    population1[i]->penalty = 0;
+
+    penalty = individual_overlap(population1[i]);
+    if (dbg_rank)
+      printf("Increasing penalty by %d for overlap\n", penalty);
+    population1[i]->penalty += penalty;
+  }
 }
 
 struct map_part **get_map_parts(struct placement *p)