From: Karryanna Date: Tue, 9 Jun 2015 11:06:09 +0000 (+0200) Subject: Labelling: Some randint call fixes X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=09a121a3bdee04f076e783a594977a95dd267a32;p=leo.git Labelling: Some randint call fixes randint(min, max) returns random number in range placements[i])); - int x = randint(1, 2); + int x = randint(0, 2); - if (x == 1) + if (x == 0) { if (dbg_breeding >= VERBOSITY_PLACEMENT) printf("Copying parent->child 1->1 and 2->2\n"); @@ -1310,7 +1310,7 @@ void mutate(void) { if (dbg_mutation >= VERBOSITY_INDIVIDUAL) printf("Creating %d-th individual by mutation\n", i); - int ind = randint(1, mutate_rbest_size); + int ind = randint(0, mutate_rbest_size); if (dbg_mutation >= VERBOSITY_INDIVIDUAL) printf("Mutating %d-th individual of original population\n", ind); population2[pop2_ind] = ep_alloc(ep_individuals);