Package net.sourceforge.jFuzzyLogic.ruleConnection

Examples of net.sourceforge.jFuzzyLogic.ruleConnection.RuleConnectionMethodOrMax


    AST child = tree.getFirstChild();
    String ruleBlockName = child.getText();
    Gpr.debug(debug, "Parsing: " + ruleBlockName);

    // Use 'default' methods
    RuleConnectionMethod and = new RuleConnectionMethodAndMin(), or = new RuleConnectionMethodOrMax();

    // Explore each sibling in this level
    for( child = child.getNextSibling(); child != null; child = child.getNextSibling() ) {
      String leaveName = child.getText();
      Gpr.debug(debug, "Parsing: " + leaveName);

      if( leaveName.equalsIgnoreCase("AND") ) {
        //---
        // Which 'AND' method to use? (Note: We alse set 'OR' method accordingly to fullfill DeMorgan's law
        //---
        if( rulesAdded ) throw new RuntimeException("AND / OR methods must be defined prior to RULE definition");
        String type = child.getFirstChild().getText();
        if( type.equalsIgnoreCase("MIN") ) {
          and = new RuleConnectionMethodAndMin();
          or = new RuleConnectionMethodOrMax();
        } else if( type.equalsIgnoreCase("PROD") ) {
          and = new RuleConnectionMethodAndProduct();
          or = new RuleConnectionMethodOrProbOr();
        } else if( type.equalsIgnoreCase("BDIF") ) {
          and = new RuleConnectionMethodAndBoundedDif();
          or = new RuleConnectionMethodOrBoundedSum();
        } else throw new RuntimeException("Unknown (or unimplemented) 'AND' method: " + type);
      } else if( leaveName.equalsIgnoreCase("OR") ) {
        //---
        // Which 'AND' method to use? (Note: We alse set 'OR' method accordingly to fullfill DeMorgan's law
        //---
        if( rulesAdded ) throw new RuntimeException("AND / OR methods must be defined prior to RULE definition");
        String type = tree.getFirstChild().getText();
        if( type.equalsIgnoreCase("MAX") ) {
          or = new RuleConnectionMethodOrMax();
          and = new RuleConnectionMethodAndMin();
        } else if( type.equalsIgnoreCase("ASUM") ) {
          or = new RuleConnectionMethodOrProbOr();
          and = new RuleConnectionMethodAndProduct();
        } else if( type.equalsIgnoreCase("BSUM") ) {
View Full Code Here

TOP

Related Classes of net.sourceforge.jFuzzyLogic.ruleConnection.RuleConnectionMethodOrMax

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.