void rank_population(void);
void plan_individual(struct individual *individual);
+int cmp_individual(const void *a, const void *b);
+
void make_bitmap(struct variant *v, struct symbol *sym);
void make_bitmap_icon(struct variant *v, struct sym_icon *si);
void make_bitmap_point(struct variant *v, struct sym_point *sp);
return overlap;
}
+int cmp_individual(const void *a, const void *b)
+{
+ struct individual **ia = (struct individual **) a;
+ struct individual **ib = (struct individual **) b;
+
+ return (*ia)->penalty - (*ib)->penalty;
+}
+
void rank_population(void)
{
int penalty;
double randdouble(void)
{
- // FIXME: How the hell shall double in range <0, 1> be generated? O:)
- return 0.5;
+ return ((double) rand() / (double) RAND_MAX);
}
void cleanup(void)