diff options
Diffstat (limited to 'src/jcgp/JCGP.java')
-rw-r--r-- | src/jcgp/JCGP.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jcgp/JCGP.java b/src/jcgp/JCGP.java index be09b4a..aa3b647 100644 --- a/src/jcgp/JCGP.java +++ b/src/jcgp/JCGP.java @@ -479,6 +479,11 @@ public class JCGP { public void reset() { finished = false; statistics = new StatisticsLogger(); + resources.setArity(problem.getFunctionSet().getMaxArity()); + if (resources.arity() < 1) { + resources.println("[CGP] Error: arity is smaller than 1. Check that at least one function is enabled"); + return; + } population = new Population(resources); resetStatisticsValues(); resources.setCurrentGeneration(1); |