Hi I am running the latest jfuzzylite release and encounter an exception when more than 1 Rule Block is defined.
Exception in thread “main” java.lang.IndexOutOfBoundsException: Index: 7, Size: 7
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at com.fuzzylite.rule.RuleBlock.getRule(RuleBlock.java:281)
at com.fuzzylite.Engine.isReady(Engine.java:257)
I have debugged the jfuzzylite source code and the problem seems to be a bug in ‘Engine.java’ (line 256).
The inner ‘for loop’ which loops over the rules in each rule block is using the rule blocks size rather than the rules size.
for (int r = 0; r < this.ruleBlocks.size(); ++r) {
Should instead be?
for (int r = 0; r < ruleBlock.getRules().size(); ++r)