8 * Callback function types
9 * (pi == population individual)
11 typedef int (*pi_rate_f) (const void *);
12 typedef void *(*pi_copy_f) (const void *);
13 typedef void (*pi_free_f) (void *);
15 typedef int (*pi_serialize) (void *, char **, size_t *);
16 typedef void *(*pi_unserialize) (char * size_t);
22 typedef struct population_s population_t;
25 * Constructor and destructor
27 population_t *population_create (pi_rate_f rate, pi_copy_f copy, pi_free_f f);
28 void population_destroy (population_t *p);
31 * Object configuration
33 int population_set_size (population_t *p, size_t population_size);
38 /* iterations == 0 => infinite */
39 void *population_get_random (population_t *p);
40 void *population_get_fittest (population_t *p);
42 int population_insert (population_t *p, void *pi);
44 /* vim: set sw=2 sts=2 et : */
45 #endif /* POPULATION_H */