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 f36ac7c..4853ff7 100644 --- a/src/jcgp/JCGP.java +++ b/src/jcgp/JCGP.java @@ -245,6 +245,11 @@ public class JCGP { public void reset() { finished = false; + 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); resources.setCurrentGeneration(1); resources.setCurrentRun(1); |