Examples of findOptimalSolution()


Examples of solver.Solver.findOptimalSolution()

          LoggerFactory.getLogger("solver").info("Average deviation: {} ", average_deviation.getLB());
                }
            }
        });
    // find optimal solution (Santa Claus is stingy)
    solver.findOptimalSolution(ResolutionPolicy.MINIMIZE,average_deviation, precision);
    // free IBEX structures from memory
    solver.getIbex().release();
    }
}
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

    public void testAll() {
        if (Configuration.PLUG_EXPLANATION) {
            Solver sol;
            sol = modeler();
            PropagationEngineFactory.values()[0].make(sol);
            sol.findOptimalSolution(ResolutionPolicy.MINIMIZE, objective);
            long nbsol = sol.getMeasures().getSolutionCount();
            long node = sol.getMeasures().getNodeCount();
            for (int t = 1; t < PropagationEngineFactory.values().length; t++) {
                sol = modeler();
                PropagationEngineFactory.values()[t].make(sol);
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

            long nbsol = sol.getMeasures().getSolutionCount();
            long node = sol.getMeasures().getNodeCount();
            for (int t = 1; t < PropagationEngineFactory.values().length; t++) {
                sol = modeler();
                PropagationEngineFactory.values()[t].make(sol);
                sol.findOptimalSolution(ResolutionPolicy.MINIMIZE, objective);
                Assert.assertEquals(sol.getMeasures().getSolutionCount(), nbsol);
                Assert.assertEquals(sol.getMeasures().getNodeCount(), node);
            }
        }
    }
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

    @Test(groups = "verylong")
    public void testSmall() {
        Solver sol;
        for (int j = 0; j < 4; j++) {
            sol = modeler(OPTIMAL_RULER[j][0]);
            sol.findOptimalSolution(ResolutionPolicy.MINIMIZE, (IntVar) sol.getVars()[OPTIMAL_RULER[j][0] - 1]);
            long sols = sol.getMeasures().getSolutionCount();
            long nodes = sol.getMeasures().getNodeCount();
            for (int k = 1; k < PropagationEngineFactory.values().length; k++) {
                sol = modeler(OPTIMAL_RULER[j][0]);
                PropagationEngineFactory.values()[k].make(sol);
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

            long sols = sol.getMeasures().getSolutionCount();
            long nodes = sol.getMeasures().getNodeCount();
            for (int k = 1; k < PropagationEngineFactory.values().length; k++) {
                sol = modeler(OPTIMAL_RULER[j][0]);
                PropagationEngineFactory.values()[k].make(sol);
                sol.findOptimalSolution(ResolutionPolicy.MINIMIZE, (IntVar) sol.getVars()[OPTIMAL_RULER[j][0] - 1]);
                Assert.assertEquals(sol.getMeasures().getSolutionCount(), sols);
                Assert.assertEquals(sol.getMeasures().getNodeCount(), nodes);

            }
        }
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

    @Test(groups = "verylong")
    public void testAll() {
        Solver sol;
        for (int j = 0; j < OPTIMAL_RULER.length; j++) {
            sol = modeler(OPTIMAL_RULER[j][0]);
            sol.findOptimalSolution(ResolutionPolicy.MINIMIZE, (IntVar) sol.getVars()[OPTIMAL_RULER[j][0] - 1]);
            long sols = sol.getMeasures().getSolutionCount();
            long nodes = sol.getMeasures().getNodeCount();
            for (int k = 1; k < PropagationEngineFactory.values().length; k++) {
                sol = modeler(OPTIMAL_RULER[j][0]);
                PropagationEngineFactory.values()[k].make(sol);
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

            long sols = sol.getMeasures().getSolutionCount();
            long nodes = sol.getMeasures().getNodeCount();
            for (int k = 1; k < PropagationEngineFactory.values().length; k++) {
                sol = modeler(OPTIMAL_RULER[j][0]);
                PropagationEngineFactory.values()[k].make(sol);
                sol.findOptimalSolution(ResolutionPolicy.MINIMIZE, (IntVar) sol.getVars()[OPTIMAL_RULER[j][0] - 1]);
                Assert.assertEquals(sol.getMeasures().getSolutionCount(), sols);
                Assert.assertEquals(sol.getMeasures().getNodeCount(), nodes);

            }
        }
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

    public void test2() {
        Solver solver = new Solver();
        IntVar iv = VF.enumerated("iv", 0, 10, solver);
        solver.post(ICF.arithm(iv, ">=", 2));

        solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, iv);
        Assert.assertEquals(iv.getValue(), 2);

        solver.getSearchLoop().reset();

        solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, iv);
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

        solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, iv);
        Assert.assertEquals(iv.getValue(), 2);

        solver.getSearchLoop().reset();

        solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, iv);
        Assert.assertEquals(iv.getValue(), 2);
    }

    @Test(groups = "1s")
    public void test3() {
View Full Code Here

Examples of solver.Solver.findOptimalSolution()

    public void test4() {
        Solver solver = new Solver();
        IntVar iv = VF.enumerated("iv", 0, 10, solver);
        BoolVar v = ICF.arithm(iv, "<=", 2).reif();

        solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, v);
//        System.out.println("Minimum1: " + iv + " : " + solver.isSatisfied());
        Assert.assertEquals(ESat.TRUE, solver.isSatisfied());

        solver.getSearchLoop().reset();
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.