From e354311547a5a5f4d817e6af5b7df99813d66ecb Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Sun, 27 Apr 2014 22:23:32 +0100 Subject: Changing function set through GUI now triggers a reset if arity changes. --- src/jcgp/backend/function/FunctionSet.java | 10 +++++----- src/jcgp/backend/function/SymbolicRegressionFunctions.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/jcgp/backend/function') diff --git a/src/jcgp/backend/function/FunctionSet.java b/src/jcgp/backend/function/FunctionSet.java index 926ed68..6a549cd 100644 --- a/src/jcgp/backend/function/FunctionSet.java +++ b/src/jcgp/backend/function/FunctionSet.java @@ -72,16 +72,16 @@ public abstract class FunctionSet { /** * Computes and returns the maximum arity out of - * all the function, enabled or disabled. + * all enabled functions. * - * @return + * @return the problem's current maximum arity. */ public int getMaxArity(){ int arity = 0; - for (Function function : functionList) { + for (Integer function : allowedFunctions) { // if a higher arity is found, store it - if (function.getArity() > arity) { - arity = function.getArity(); + if (functionList[function].getArity() > arity) { + arity = functionList[function].getArity(); } } return arity; diff --git a/src/jcgp/backend/function/SymbolicRegressionFunctions.java b/src/jcgp/backend/function/SymbolicRegressionFunctions.java index a35f258..cf5c33f 100644 --- a/src/jcgp/backend/function/SymbolicRegressionFunctions.java +++ b/src/jcgp/backend/function/SymbolicRegressionFunctions.java @@ -197,7 +197,7 @@ public class SymbolicRegressionFunctions extends FunctionSet { } /** - * Exponential function. Returns the exponential of input 0. + * Exponential function. Returns e raised to input 0. * * @see Math */ -- cgit v1.2.3