1 #ifndef SN_POPULATION_H
2 #define SN_POPULATION_H 1
5 #include "sn_network.h"
10 * Opaque data type for the population.
12 struct sn_population_s;
13 typedef struct sn_population_s sn_population_t;
15 sn_population_t *sn_population_create (uint32_t size);
16 void sn_population_destroy (sn_population_t *p);
21 * Puts a new network into the population. The network is _copied_ and may be
22 * modified by the caller after inserting the network. This won'thave an effect
23 * on the copy in the population, though. Of course, the caller must free his
26 int sn_population_push (sn_population_t *p, sn_network_t *n);
31 * Returns a _copy_ of an individuum in the population. The network is NOT
32 * removed from the population by this operation! The caller must free this
33 * copy himself. Returns NULL upon failure.
35 sn_network_t *sn_population_pop (sn_population_t *p);
37 sn_network_t *sn_population_best (sn_population_t *p);
39 #endif /* SN_POPULATION_H */