- if (rating < best_rating)
- {
- if (best_output_file != NULL)
- {
- printf ("Writing network with rating %i to %s\n",
- rating, best_output_file);
- sn_network_write_file (n, best_output_file);
- }
- else
- {
- printf ("New best solution has rating %i\n",
- rating);
- }
- }
-
- nmemb = max_population_size - (worst_index + 1);
-
- sn_network_destroy (population[worst_index].network);
- population[worst_index].network = NULL;
-
- memmove (population + worst_index,
- population + (worst_index + 1),
- nmemb * sizeof (population_entry_t));