From 6769419bea279935c4a3a84616d45ee7d4a6345c Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Tue, 22 Apr 2014 08:48:11 +0100 Subject: Chromosome parser is buggy, need to fix that. --- src/jcgp/backend/resources/Resources.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/jcgp/backend/resources') 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 -- cgit v1.2.3