Package solver.constraints.real

Examples of solver.constraints.real.RealConstraint


    funBuilder.append(")/").append(n_kids).append("=").append('{').append(n_kids).append('}');

        RealVar[] all_vars = ArrayUtils.append(VariableFactory.real(kid_price, precision), new RealVar[]{average});
    String function = funBuilder.toString();

        solver.post(new RealConstraint(function, all_vars));
    }
View Full Code Here


        // 4 integer variables (price in cents)
        itemCost = VariableFactory.boundedArray("item", 4, 1, 711, solver);
        // views as real variables to be used by Ibex
        realitemCost = VariableFactory.real(itemCost, epsilon);

  solver.post(new RealConstraint("Sum", "{0} + {1} + {2} + {3} = 711", Ibex.COMPO, realitemCost));
  solver.post(new RealConstraint("Product", "{0} * {1}/100 * {2}/100 * {3}/100 = 711", Ibex.HC4, realitemCost));
        // symmetry breaking
        solver.post(new RealConstraint("SymmetryBreaking","{0} <= {1};{1} <= {2};{2} <= {3}", Ibex.HC4, realitemCost));
    }
View Full Code Here

    // compute total cost
        solver.post(IntConstraintFactory.sum(kid_price, total_cost));

    // compute average cost (i.e. average gift cost per kid)
    RealVar[] allRV = ArrayUtils.append(realViews,new RealVar[]{average,average_deviation});
    solver.post(new RealConstraint(
        "Avg/AvgDev",
        "({0}+{1}+{2})/3={3};(abs({0}-{3})+abs({1}-{3})+abs({2}-{3}))/3={4}",
        allRV)
    );
View Full Code Here

        x = VariableFactory.real("x", Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, precision, solver);
        y = VariableFactory.real("y", -1.0e8, 1.0e8, precision, solver);
        z = VariableFactory.real("z", -1.0e8, 1.0e8, precision, solver);

        vars = new RealVar[]{x, y, z};
    solver.post(new RealConstraint("RealConstraint",
        /*rcons.addFunction("{1}^2 * (1 + {2}^2) + {2} * ({2} - 24 * {1}) = -13", vars, Ibex.COMPO);
        rcons.addFunction("{0}^2 * (1 + {1}^2) + {1} * ({1} - 24 * {0}) = -13", vars, Ibex.COMPO);
        rcons.addFunction("{2}^2 * (1 + {0}^2) + {0} * ({0} - 24 * {2}) = -13", vars);*/
            "{1}^2 * (1 + {2}^2) + {2} * ({2} - 24 * {1}) = -13;" +
                "{0}^2 * (1 + {1}^2) + {1} * ({1} - 24 * {0}) = -13;" +
View Full Code Here

    x = VariableFactory.real(intx,precision);
    y = VariableFactory.real("y", -1.0e8, 1.0e8, precision, solver);
    z = VariableFactory.real("z", -1.0e8, 1.0e8, precision, solver);

    vars = new RealVar[]{x, y, z};
    solver.post(new RealConstraint(
        "CycloHexan",
        "{1}^2 * (1 + {2}^2) + {2} * ({2} - 24 * {1}) = -13;" +
            "{0}^2 * (1 + {1}^2) + {1} * ({1} - 24 * {0}) = -13;" +
            "{2}^2 * (1 + {0}^2) + {0} * ({0} - 24 * {2}) = -13",
        Ibex.HC4_NEWTON,
View Full Code Here

    public void testreal() {
        Solver solver = new Solver();
        double PREC = 0.01d; // precision
        RealVar x = VariableFactory.real("x", -1.0d, 1.0d, PREC, solver);
        RealVar y = VariableFactory.real("y", -1.0d, 1.0d, PREC, solver);
        RealConstraint rc = new RealConstraint(
                "my fct",
                "({0}*{1})+sin({0})=1.0;ln({0}+[-0.1,0.1])>=2.6",
                Ibex.HC4,
                x, y);
        solver.post(rc);
View Full Code Here

TOP

Related Classes of solver.constraints.real.RealConstraint

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.