home Forums # Technical Support Error with Multiple Rule blocks

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #2521

    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)



    thank you for your post.

    This is indeed a bug, and your proposed solution fixes it. I will make the change in jfuzzylite. This bug is not present in fuzzylite, though.



Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.