From: Florian Forster Date: Wed, 26 Nov 2008 22:08:39 +0000 (+0100) Subject: src/sn-evolution.c: Make the output a bit nicer. X-Git-Tag: v1.0.0~84 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6758d206587487889b03359c07db497d2afa8df4;p=sort-networks.git src/sn-evolution.c: Make the output a bit nicer. --- diff --git a/src/sn-evolution.c b/src/sn-evolution.c index 3c11adb..9ceff88 100644 --- a/src/sn-evolution.c +++ b/src/sn-evolution.c @@ -298,17 +298,32 @@ static int evolution_start (int threads_num) if (status == 0) { sn_network_t *n; + int stages_num; + int comparators_num; int rating; + int iter; - i = iteration_counter; + iter = iteration_counter; n = population_get_fittest (population); + rating = rate_network (n); + + stages_num = SN_NETWORK_STAGE_NUM (n); + comparators_num = 0; + for (i = 0; i < stages_num; i++) + { + sn_stage_t *s; + + s = SN_NETWORK_STAGE_GET (n, i); + comparators_num += SN_STAGE_COMP_NUM (s); + } + sn_network_destroy (n); - printf ("After approximately %i iterations: " - "Currently best rating: %i\n", - i, rating); + printf ("Best after approximately %i iterations: " + "%i comparators in %i stages. Rating: %i.\n", + iter, comparators_num, stages_num, rating); } }