Package expressions

Examples of expressions.FuzzyExpression.eval()


        }

        List<FuzzyLiteral> res = new ArrayList();
        for (int i = 0; i < numberOfConstraints; i++) {
            FuzzyExpression exp = getRandomExpression(variables, pBinary, pUnary, pVar, pConst, maxDepth);
            double value = exp.eval(interpretation);
//           double upperbound = ceil(value + rand.nextDouble()*(1-value));
//           double lowerbound = floor(rand.nextDouble()*value);
            double upperbound = ceil(value);
            double lowerbound = floor(value);
            res.add(new FuzzyLiteral(lowerbound, upperbound, exp));
View Full Code Here


            FuzzyExpression exp = getRandomExpression2(variables, pNegation, nrVariablesPerClause);
           //PAT: door onderstaande twee lijnen in commentaar te zetten krijgen we
            //ook meerdere voorkomens van een var in 1 clause.
            // while (exp.getVariables().size() != nrVariablesPerClause)
           //     exp = getRandomExpression2(variables, pNegation, nrVariablesPerClause);
            double value = exp.eval(interpretation);
//           double upperbound = ceil(value + rand.nextDouble()*(1-value));
//           double lowerbound = floor(rand.nextDouble()*value);
            double upperbound;
            double lowerbound;
            if (rand.nextDouble() < 0.5) {
View Full Code Here

        for (int i = 0; i < numberOfConstraints; i++) {
            FuzzyExpression exp = getRandomExpression2(variables, pNegation, nrVariablesPerClause);
           // while (exp.getVariables().size() != nrVariablesPerClause)
             //   exp = getRandomExpression2(variables, pNegation, nrVariablesPerClause);
            //PAT: door de twee bovenstaande lijnen in commentaar te zetten, krijg je ook clauses waar een bepaalde var meer dan 1 keer kan voorkomen
            double value = exp.eval(interpretation);
//           double upperbound = ceil(value + rand.nextDouble()*(1-value));
//           double lowerbound = floor(rand.nextDouble()*value);
            double upperbound;
            double lowerbound;
            upperbound = ceil(value);
View Full Code Here

            while (exp.getVariables().size() != nrVariablesPerClause)
                exp = getRandomExpression2(variables, pNegation, nrVariablesPerClause);
            double upperbound = 1;
            double lowerbound = 0;
            if (i < nrSatisfiableConstraints)
                lowerbound = floor(exp.eval(interpretation));
            else
                lowerbound = ceil(rand.nextDouble());
            res.add(new FuzzyLiteral(lowerbound, upperbound, exp));
        }
        return res;
View Full Code Here

            while (exp.getVariables().size() != nrVariablesPerClause)
                exp = getRandomExpression2(variables, pNegation, nrVariablesPerClause);
            double upperbound = 1;
            double lowerbound;
            if (rand.nextDouble() < 0.5)
                lowerbound = floor(exp.eval(interpretation1));
            else
                lowerbound = floor(exp.eval(interpretation2));

            res.add(new FuzzyLiteral(lowerbound, upperbound, exp));
        }
View Full Code Here

            double upperbound = 1;
            double lowerbound;
            if (rand.nextDouble() < 0.5)
                lowerbound = floor(exp.eval(interpretation1));
            else
                lowerbound = floor(exp.eval(interpretation2));

            res.add(new FuzzyLiteral(lowerbound, upperbound, exp));
        }
        return res;
    }
View Full Code Here

            while (exp.getVariables().size() != nrVariablesPerClause)
                exp = getRandomMixedExpression(variables, pNegation, pMinimum, nrVariablesPerClause);
            double upperbound = 1;
            double lowerbound;
            if (rand.nextDouble() < 0.5)
                lowerbound = floor(exp.eval(interpretation1));
            else
                lowerbound = floor(exp.eval(interpretation2));

            res.add(new FuzzyLiteral(lowerbound, upperbound, exp));
        }
View Full Code Here

            double upperbound = 1;
            double lowerbound;
            if (rand.nextDouble() < 0.5)
                lowerbound = floor(exp.eval(interpretation1));
            else
                lowerbound = floor(exp.eval(interpretation2));

            res.add(new FuzzyLiteral(lowerbound, upperbound, exp));
        }
        return res;
    }
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.