From 1449a1da915823283ac33c6a3a8a7c5a057677ef Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 11 Mar 2009 11:50:52 +0100 Subject: [PATCH] src/sn-evolution2.c: Make mutations more likely. --- src/sn-evolution2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sn-evolution2.c b/src/sn-evolution2.c index b5beca4..07c33a2 100644 --- a/src/sn-evolution2.c +++ b/src/sn-evolution2.c @@ -255,7 +255,7 @@ static int mutate_network (sn_comparator_t *comparators, int comparators_num) int i; for (i = 0; i < comparators_num; i++) - if (sn_bounded_random (0, 1000) == 0) + if (sn_bounded_random (0, 1000000) >= 972655) comparators[i] = get_random_comparator (); return (0); @@ -349,8 +349,7 @@ static int create_offspring (void) } - if (sn_bounded_random (0, 1000) == 0) - mutate_network (n_comparators, n_comparators_num); + mutate_network (n_comparators, n_comparators_num); n = sn_network_create (inputs_num); for (i = 0; i < n_comparators_num; i++) -- 2.11.0