Examples of RuleConnectionMethodOrMax


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

Examples of net.sourceforge.jFuzzyLogic.ruleConnectionMethod.RuleConnectionMethodOrMax

    Rule rule3 = new Rule("Rule3", ruleBlock);
    RuleTerm term1 = new RuleTerm(service, "good", false); // Create 'terms'
    RuleTerm term2 = new RuleTerm(service, "excellent", false);
    RuleTerm term3 = new RuleTerm(food, "delicious", false);

    RuleExpression antecedentOr = new RuleExpression(term1, term2, new RuleConnectionMethodOrMax()); // Combine terms using connection methods: OR, AND
    RuleExpression antecedentAnd = new RuleExpression(antecedentOr, term3, new RuleConnectionMethodAndMin());
    rule3.setAntecedents(antecedentAnd); // Set antecedent

    rule3.addConsequent(tip, "generous", false);
    ruleBlock.add(rule3);
View Full Code Here

Examples of net.sourceforge.jFuzzyLogic.ruleConnectionMethod.RuleConnectionMethodOrMax

    if( debug ) Gpr.debug("Tree: " + tree.toStringTree());
    name = tree.getChild(0).getText();
    if( debug ) Gpr.debug("RuleBlock name: " + name);

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

    // Explore each sibling in this level
    for( int childNum = 1; childNum < tree.getChildCount(); childNum++ ) {
      Tree child = tree.getChild(childNum);
      if( debug ) Gpr.debug("Parsing: " + child.toStringTree());
      String leaveName = child.getText();

      if( leaveName.equalsIgnoreCase("AND") ) {
        //---
        // Which 'AND' method to use? (Note: We also set 'OR' method accordingly to fulfill DeMorgan's law
        //---
        if( rulesAdded ) throw new RuntimeException("AND method must be defined prior to RULE definition");
        String type = child.getChild(0).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 'OR' method to use? (Note: We also set 'AND' method accordingly to fulfill DeMorgan's law
        //---
        if( rulesAdded ) throw new RuntimeException("OR method must be defined prior to RULE definition");
        String type = child.getChild(0).getText(); // Bug corrected by Arkadiusz M. amaterek@users.sourceforge.net
        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
Copyright © 2018 www.massapi.com. 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.