Package fuzzysat

Examples of fuzzysat.FuzzyLiteral


    return new FuzzyMultiExpression(args,getBodyOperator());
  }

  @Override
  public FuzzyLiteral convertToFuzzyLiteral(Double lowerBound) {
    return new FuzzyLiteral(lowerBound,1.0,convertToFuzzyExpression());
  }
View Full Code Here


   * We can ignore the lowerBound as a regular rule needs to be fulfilled
   * to a degree of 1.0.
   */
  //@Override
  public FuzzyLiteral convertToFuzzyLiteral(Double lowerBound) {
    return new FuzzyLiteral(1.0,1.0,convertToFuzzyExpression());
  }
View Full Code Here

   * We can ignore the lowerBound as a regular constraint needs to
   * be fulfilled to degree 1.0.
   */
  @Override
  public FuzzyLiteral convertToFuzzyLiteral(Double lowerBound) {
    return new FuzzyLiteral(1.0,1.0,convertToFuzzyExpression());
  }
View Full Code Here

    public void addFuzzyClause(FuzzyClause fc) {
//        System.out.println("voor = " + fc);
        ArrayList<Literal> newLiterals = new ArrayList<Literal>();
        for (Literal l : fc.getDisjuncts()) {
            FuzzyLiteral flit = (FuzzyLiteral) l;
            FuzzyExpression newExp = flit.getExpression().accept(dnegElim);
            newLiterals.add(new FuzzyLiteral(flit.getLowerBound(),
                                             flit.getUpperBound(), newExp));
        }
        FuzzyClause fcnieuw = new FuzzyClause(newLiterals);
//        System.out.println("na = " + fcnieuw);
        clauses.add(fcnieuw);
    }
View Full Code Here

//        List<FuzzyClause> clauses = RandomProblemGenerator.readConstraintsFromFile(
//        new File("dataset/problem0.txt"));
       
       
        List<FuzzyClause> clauses = new ArrayList();
        FuzzyLiteral lit = new FuzzyLiteral(0.25,0.75,new FuzzyConstantExpression(0.5));
        FuzzyClause cl = new FuzzyClause(lit);
        clauses.add(cl);
        MinionCSPSolver s = new MinionCSPSolver(1,new HashMap(), 4);
        for(FuzzyClause fc:clauses)
            s.addFuzzyClause(fc);
View Full Code Here

      DoubleNegationEliminator dnegElim = new DoubleNegationEliminator();
      ArrayList<FuzzyClause> newClauses = new ArrayList<FuzzyClause>();
      for (FuzzyClause c : clauses) {
        ArrayList<Literal> newLiterals = new ArrayList<Literal>();
        for (Literal l : c.getDisjuncts()) {
          FuzzyLiteral flit = (FuzzyLiteral) l;
          FuzzyExpression newExp = flit.getExpression().accept(dnegElim);
          newLiterals.add(new FuzzyLiteral(flit.getLowerBound(),
              flit.getUpperBound(), newExp));
        }
        newClauses.add(new FuzzyClause(newLiterals));
      }

      // overwrite the old clauses with the simplified ones ...
View Full Code Here

    DoubleNegationEliminator dnegElim = new DoubleNegationEliminator();
    ArrayList<FuzzyClause> newClauses = new ArrayList<FuzzyClause>();
    for (FuzzyClause c : clauses) {
      ArrayList<Literal> newLiterals = new ArrayList<Literal>();
      for (Literal l : c.getDisjuncts()) {
        FuzzyLiteral flit = (FuzzyLiteral) l;
        FuzzyExpression newExp = flit.getExpression().accept(dnegElim);
        newLiterals.add(new FuzzyLiteral(flit.getLowerBound(),
            flit.getUpperBound(), newExp));
      }
      newClauses.add(new FuzzyClause(newLiterals));
    }

    // overwrite the old clauses with the simplified ones ...
View Full Code Here

    DoubleNegationEliminator dnegElim = new DoubleNegationEliminator();
    ArrayList<FuzzyClause> newClauses = new ArrayList<FuzzyClause>();
    for (FuzzyClause c : clauses) {
      ArrayList<Literal> newLiterals = new ArrayList<Literal>();
      for (Literal l : c.getDisjuncts()) {
        FuzzyLiteral flit = (FuzzyLiteral) l;
        FuzzyExpression newExp = flit.getExpression().accept(dnegElim);
        newLiterals.add(new FuzzyLiteral(flit.getLowerBound(),
            flit.getUpperBound(), newExp));
      }
      newClauses.add(new FuzzyClause(newLiterals));
    }

    // overwrite the old clauses with the simplified ones ...
View Full Code Here

   * We don't care about the lowerbound for choice rules, they can be fulfilled to
   * an arbitrary degree.
   */
  @Override
  public FuzzyLiteral convertToFuzzyLiteral(Double lowerBound) {
    return new FuzzyLiteral(0.0,1.0,convertToFuzzyExpression());
  }
View Full Code Here

      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()))));
      }
    }
View Full Code Here

TOP

Related Classes of fuzzysat.FuzzyLiteral

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.