Package solver

Examples of solver.Solver.findOptimalSolution()


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

        solver.getSearchLoop().reset();

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

    @Test(groups = "1s")
View Full Code Here


//            @Override
//            public String print() {
//                return Arrays.toString(vars) + " o:" + obj;
//            }
//        });
        solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, obj);
    }


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

    switch (mode){
      case 0:  solver.findSolution();
//        print(solver,last,graph,f);
        if(solver.hasReachedLimit())return -1;
        return solver.getMeasures().getSolutionCount();
      case 1:  solver.findOptimalSolution(ResolutionPolicy.MINIMIZE,last);
//        print(solver,last,graph,f);
        if(solver.hasReachedLimit())return -1;
        return solver.getMeasures().getBestSolutionValue().longValue();
      case 2:  solver.findAllSolutions();// too many solutions to be used
//        print(solver,last,graph,f);
View Full Code Here

        for (int i = 0; i < vars.length; i++) {
            Constraint c = IntConstraintFactory.table(vars[i], reified[i], tuples, type);
            solver.post(c);
        }
        solver.post(IntConstraintFactory.sum(reified, sum));
        solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, sum);
        if (solver.getMeasures().getSolutionCount() > 0) {
            for (int i = 0; i < vars.length; i++) {
                System.out.print(vars[i].getValue() + "\t");
            }
            System.out.println("");
View Full Code Here

            IntVar[] allvars = ArrayUtils.append(nexts, exps, bws, new IntVar[]{sum});


            solver.set(IntStrategyFactory.minDom_LB(allvars));
            solver.findOptimalSolution(ResolutionPolicy.MAXIMIZE, sum);
        }
    }

    @Test(groups = "10m")
    public void testStynes2() {
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.