Examples of propagate()


Examples of solver.Solver.propagate()

        b[1] = VariableFactory.enumerated("b3", new int[]{-3, -2}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
            Assert.fail();
        }
        Assert.assertEquals(5, a[0].getUB());
//        SearchMonitorFactory.log(solver, true, true);
View Full Code Here

Examples of solver.Solver.propagate()

        b[1] = VariableFactory.enumerated("b2", new int[]{-6, -1}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
            Assert.fail();
        }
        Assert.assertEquals(-2, a[0].getUB());
        solver.findAllSolutions();
View Full Code Here

Examples of solver.Solver.propagate()

        b[1] = VariableFactory.enumerated("b2", new int[]{-6, -1}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
            Assert.fail();
        } catch (ContradictionException e) {
        }
        Assert.assertEquals(solver.getMeasures().getSolutionCount(), 0);
    }
View Full Code Here

Examples of solver.Solver.propagate()

        b[4] = VariableFactory.enumerated("b5", new int[]{0, 1, 2}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
        }
        solver.findAllSolutions();
        Assert.assertEquals(solver.getMeasures().getSolutionCount(), 216);
    }
View Full Code Here

Examples of solver.Solver.propagate()

        b[2] = VariableFactory.enumerated("b3", new int[]{-4, 2}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
            Assert.fail();
        }
        Assert.assertEquals(-1, b[0].getLB());
//        SearchMonitorFactory.log(solver, true, false);
View Full Code Here

Examples of solver.Solver.propagate()

    public void testMinus1() {
        Solver solver = new Solver();
        IntVar var = VariableFactory.minus(VariableFactory.enumerated("b", new int[]{1, 2, 4}, solver));
    if(!Configuration.ENABLE_VIEWS){
      try {
        solver.propagate();
      }catch (Exception e){
        e.printStackTrace();
        throw new UnsupportedOperationException();
      }
    }
View Full Code Here

Examples of solver.Solver.propagate()

    public void testMinus2() {
        Solver solver = new Solver();
        IntVar var = VariableFactory.minus(VariableFactory.enumerated("b", new int[]{1, 2, 4}, solver));
    if(!Configuration.ENABLE_VIEWS){
      try {
        solver.propagate();
      }catch (Exception e){
        e.printStackTrace();
        throw new UnsupportedOperationException();
      }
    }
View Full Code Here

Examples of solver.Solver.propagate()

    public void testMinus3() {
        Solver solver = new Solver();
        IntVar var = VariableFactory.minus(VariableFactory.enumerated("b", new int[]{1, 2, 4}, solver));
    if(!Configuration.ENABLE_VIEWS){
      try {
        solver.propagate();
      }catch (Exception e){
        e.printStackTrace();
        throw new UnsupportedOperationException();
      }
    }
View Full Code Here

Examples of solver.Solver.propagate()

    public void testMinus4() {
        Solver solver = new Solver();
        IntVar var = VariableFactory.minus(VariableFactory.enumerated("b", new int[]{1, 2, 4}, solver));
    if(!Configuration.ENABLE_VIEWS){
      try {
        solver.propagate();
      }catch (Exception e){
        e.printStackTrace();
        throw new UnsupportedOperationException();
      }
    }
View Full Code Here

Examples of solver.Solver.propagate()

    @Test(groups = "1s")
    public void testAbs1() {
        Solver solver = new Solver();
        IntVar var = VariableFactory.abs(VariableFactory.enumerated("b", new int[]{-2, 1, 4}, solver));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
            e.printStackTrace();
        }
        DisposableValueIterator vit = var.getValueIterator(true);
        Assert.assertTrue(vit.hasNext());
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.