diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-22 08:48:11 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-22 08:48:11 +0100 |
commit | 6769419bea279935c4a3a84616d45ee7d4a6345c (patch) | |
tree | 79a8c80865f0663e82eb9986f5b7c5f999e64aab /src/jcgp/backend/resources | |
parent | efe490fec1c7a94f004b496c7c97c82083fe44ec (diff) |
Chromosome parser is buggy, need to fix that.
Diffstat (limited to 'src/jcgp/backend/resources')
-rw-r--r-- | src/jcgp/backend/resources/Resources.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/jcgp/backend/resources/Resources.java b/src/jcgp/backend/resources/Resources.java index 151d536..6eb75cd 100644 --- a/src/jcgp/backend/resources/Resources.java +++ b/src/jcgp/backend/resources/Resources.java @@ -320,6 +320,16 @@ public class Resources { return functionSet; } + public int getFunctionIndex(Function function) { + for (int i = 0; i < functionSet.getTotalFunctionCount(); i++) { + if (function == functionSet.getFunction(i)) { + return i; + } + } + // not found, default to 0 + return 0; + } + /* * Console functionality * These are affected by parameter report |