From 09a121a3bdee04f076e783a594977a95dd267a32 Mon Sep 17 00:00:00 2001 From: Karryanna Date: Tue, 9 Jun 2015 13:06:09 +0200 Subject: [PATCH] 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); -- 2.39.2