aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/backend/resources')
-rw-r--r--src/jcgp/backend/resources/Resources.java10
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