From 7411105e30e24a98d187d5e7f324d11d7dd7ea56 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 5 Oct 2009 02:24:27 +0000 Subject: cleanup --- weasel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/weasel.c b/weasel.c index 0dd341f..21cd3a2 100644 --- a/weasel.c +++ b/weasel.c @@ -110,6 +110,7 @@ printpopulation(int maximal) break; } printw("\n"); + clrtobot(); } struct creature * @@ -225,7 +226,7 @@ main(int argc, char **argv) extern int LINES; int population = 1000; int mutationrate = 100; /* 1/n */ - int nthreads; + int nthreads = population / 5; int i, c, t; while ((c = getopt(argc, argv, "m:p:t:")) != -1) @@ -243,6 +244,7 @@ main(int argc, char **argv) population = i; else usage(); + nthreads = population / 5; break; case 't': i = atoi(optarg); @@ -267,7 +269,6 @@ main(int argc, char **argv) args.population = population; args.mutationrate = mutationrate; - nthreads = population / 10; if (!nthreads) nthreads = 1; threads = calloc(nthreads, sizeof(pthread_t)); @@ -290,8 +291,8 @@ main(int argc, char **argv) pthread_mutex_destroy(&mutexsum); free(threads); - printw("\nhalted after %d generations of %d population (%d births)\n", - nthreads * i / population, population, nthreads * i); + printw("\nhalted after %d generations with population of %d (%d births, %d simultaneous)\n", + nthreads * i / population, population, nthreads * i, nthreads); refresh(); endwin(); -- cgit v1.2.3