From e28a764a7138f9343f85d98a83bd3dcd9ab4cd56 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 26 Nov 2008 23:09:56 +0100 Subject: [PATCH] src/sn-evolution.c: Don't mutate large networks. The required brute-force checking can only be done for small (e. g. 16 inputs) networks. --- src/sn-evolution.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sn-evolution.c b/src/sn-evolution.c index 9ceff88..62b01eb 100644 --- a/src/sn-evolution.c +++ b/src/sn-evolution.c @@ -248,7 +248,7 @@ static int create_offspring (void) assert (SN_NETWORK_INPUT_NUM (n) == inputs_num); - if (sn_bounded_random (0, 100) <= 1) + if ((SN_NETWORK_INPUT_NUM (n) <= 16) && (sn_bounded_random (0, 100) <= 1)) mutate_network (n); population_insert (population, n); -- 2.11.0