Package operators

Examples of operators.SM


                args.add(r.convertBodyExpression());
                args.add(new FuzzyConstantExpression(rho.getValue(r)));
                FuzzyExpression support = new FuzzyMultiExpression(args, r.getRuleTNorm());
                if (litMap.containsKey(l)) {
                    // Use the maximum directly in the expression associated.
                    litMap.put(l, new FuzzyBinaryExpression(litMap.get(l), support, new SM()));
                } else {
                    litMap.put(l, support);
                }
            }
        }
View Full Code Here


    for (GroundLiteral a : getHerbrandBase()) {
      for (GroundRule r : getRules()) {
        if (r.getHead().equals(a)) {
          if (ruleMap.containsKey(a)) {
            FuzzyExpression expr = ruleMap.get(a);
            ruleMap.put(a, new FuzzyBinaryExpression(r.convertBodyExpression(), expr, new SM()));
          } else {
            ruleMap.put(a, r.convertBodyExpression());
          }
        }
      }
View Full Code Here

    // 2.a Create antecedent: max(l1,...,ln) for l in loop
    ArrayList<FuzzyExpression> antList = new ArrayList<FuzzyExpression>();
    for (GroundLiteral l : loop) {
      antList.add(new FuzzyVariableExpression(l.toString()));
    }
    FuzzyExpression ant = new FuzzyMultiExpression(antList, new SM());
    // 2.b Create consequent: max(B1,...,Bn) for l <- Bi in R^{+}(P,L)
    ArrayList<FuzzyExpression> consList = new ArrayList<FuzzyExpression>();
    // Add a zero for elements that never occur in the head of a rule
    consList.add(new FuzzyConstantExpression(0.0));
    for (GroundRule r : rMinus) {
      consList.add(r.convertBodyExpression());
    }
    FuzzyExpression cons = new FuzzyMultiExpression(consList, new SM());
    return new FuzzyClause(
        new FuzzyLiteral(1.0, 1.0, new FuzzyBinaryExpression(ant, cons, new IW())));
  }
View Full Code Here


      while (loopIt.hasNext()) {
        antecExp = new FuzzyBinaryExpression(antecExp,
            new FuzzyVariableExpression(loopIt.next().toString()),
            new SM());
      }

      // Now create the consequent by stringing together the completion
      // formulas of the rules in RMINUS with SM:
      Iterator<GroundRule> ruleIt = RMINUS.iterator();
      FuzzyExpression consExp;


      if (ruleIt.hasNext()) {
        GroundRule firstRule = ruleIt.next();
        consExp = firstRule.createCompletion();


        while (ruleIt.hasNext()) {
          consExp = new FuzzyBinaryExpression(consExp,
              ruleIt.next().createCompletion(), new SM());
        }


      } else {
        // If RMINUS is empty, we have to have 0.0, i.e. none of the
View Full Code Here

TOP

Related Classes of operators.SM

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.