Package operators

Examples of operators.IW


    }
  }

  // TODO: allow rules with different rule implications.
  public MultiOperator getRuleImplicator () {
    return new IW();
  }
View Full Code Here


      if (ruleMap.containsKey(a)) {
        bodyExpr = ruleMap.get(a);
      } else {
        bodyExpr = new FuzzyConstantExpression(0.0);
      }
      FuzzyExpression exp1 = new FuzzyBinaryExpression(aExpr, bodyExpr, new IW());
      FuzzyExpression exp2 = new FuzzyBinaryExpression(bodyExpr, aExpr, new IW());
      // TODO DEBUG commenting out following line is a test
      //clauseList.add(new FuzzyClause(
      //    new FuzzyLiteral(1.0, 1.0, new FuzzyBinaryExpression(exp1, exp2, new TM()))));
      // TODO DEBUG adding the following two lines is a test as well ...
      clauseList.add(new FuzzyClause(new FuzzyLiteral(1.0,1.0, exp1)));
      clauseList.add(new FuzzyClause(new FuzzyLiteral(1.0,1.0,exp2)));
      //compArgs.add(new FuzzyBinaryExpression(aExpr, bodyExpr, new IW()));
      //compArgs.add(new FuzzyBinaryExpression(bodyExpr, aExpr, new IW()));
    }

    // Add clauses for constraints (only with Lukasiewicz implicator)
    // TODO: add other implicators or something
    for (GroundRule r : getRules()) {
      if (r.getHead() instanceof LattVal) {
        Double headVal = ((LattVal) r.getHead()).getValue();
        clauseList.add(new FuzzyClause(
            new FuzzyLiteral(1.0, 1.0,
            new FuzzyBinaryExpression(r.convertBodyExpression(),
            new FuzzyConstantExpression(headVal), new IW()))));
      }
    }

    return clauseList;
View Full Code Here

    // such that H(r_i) = a for i = 1..n, hence we add them as two implications.
    for (GroundLiteral l : ruleMap.keySet()) {
      FuzzyExpression litExp = l.convertToFuzzyExpression();
      FuzzyExpression bodyExp = ruleMap.get(l);
      // Add the first implication of the equivalence
      literalList.add(new FuzzyLiteral(1.0, 1.0, new FuzzyBinaryExpression(litExp, bodyExp, new IW())));
      // The second implication of the equivalence
      literalList.add(new FuzzyLiteral(1.0, 1.0, new FuzzyBinaryExpression(bodyExp, litExp, new IW())));


    } // Finally add l = 0 for each non-naf literal occurring nowhere in a rule head.
    // TODO: untested!
    for (GroundLiteral l : getLiterals()) {
      if (l.isNaf()) {
        l = new GroundLiteral(l.getPredicate(), l.isNegated(), false, null);
      }


      if (!ruleMap.containsKey(l)) // We'll add IW(l,0) = 1, which is equivalent to l = 0 as IW(l,0) = 1-l
      {
        literalList.add(new FuzzyLiteral(1.0, 1.0, new FuzzyBinaryExpression(
            l.convertToFuzzyExpression(), new FuzzyConstantExpression(0), new IW())));
      }


    }
View Full Code Here

    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

        // the loop should be zero.
        consExp = new FuzzyConstantExpression(0.0);


      }
      return new FuzzyLiteral(1.0, 1.0, new FuzzyBinaryExpression(antecExp, consExp, new IW()));


    } else {
      // If there is no loop, this method shouldn't have been called, so
      // we return an easy literal.
View Full Code Here

TOP

Related Classes of operators.IW

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.