From: Florian Forster Date: Wed, 26 Nov 2008 22:09:56 +0000 (+0100) Subject: src/sn-evolution.c: Don't mutate large networks. X-Git-Tag: v1.0.0~83 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e28a764a7138f9343f85d98a83bd3dcd9ab4cd56;p=sort-networks.git 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. --- 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);