src/sn-evolution.c: Write best network to output file if given.
authorFlorian Forster <octo@leeloo.home.verplant.org>
Fri, 25 Apr 2008 09:15:20 +0000 (11:15 +0200)
committerFlorian Forster <octo@leeloo.home.verplant.org>
Fri, 25 Apr 2008 09:15:20 +0000 (11:15 +0200)
src/sn-evolution.c

index 9cf56f5..e319660 100644 (file)
@@ -343,14 +343,16 @@ int main (int argc, char **argv)
 
   printf ("Exiting after %llu iterations.\n", iteration_counter);
 
-  if (best_output_file == NULL)
   {
     sn_network_t *n;
 
     n = sn_population_best (population);
     if (n != NULL)
     {
-      sn_network_show (n);
+      if (best_output_file != NULL)
+       sn_network_write_file (n, best_output_file);
+      else
+       sn_network_show (n);
       sn_network_destroy (n);
     }
   }