Package solver

Examples of solver.Solver.propagate()


        ts[1] = VariableFactory.enumerated("t1", new int[]{-3, -2, -1, 1, 2}, solver);
        ts[2] = VariableFactory.enumerated("t2", new int[]{-3, -2, -1, 1, 2, 3}, solver);
        ts[3] = VariableFactory.enumerated("t3", new int[]{-3, -2, -1, 1, 2, 3}, solver);

        try {
            solver.propagate();
            ts[0].removeValue(2, Cause.Null);
            ts[1].removeValue(2, Cause.Null);
            ts[0].removeValue(3, Cause.Null);
            ts[1].removeValue(1, Cause.Null);
            ts[2].removeValue(-3, Cause.Null);
View Full Code Here


            ts[1].removeValue(1, Cause.Null);
            ts[2].removeValue(-3, Cause.Null);
            ts[2].removeValue(3, Cause.Null);
            ts[3].removeValue(-3, Cause.Null);
            ts[3].removeValue(3, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ignored) {

        }
//        System.out.printf("%s\n", solver.toString());
View Full Code Here

        ts[1] = VariableFactory.enumerated("t1", 1, 3, solver);
        ts[2] = VariableFactory.enumerated("t2", 1,3, solver);

        solver.post(ICF.alldifferent(ts, "BC"));

        solver.propagate();
        Assert.assertEquals(ts[1].getDomainSize(),2);
        Assert.assertEquals(ts[2].getDomainSize(),2);
    }
}
View Full Code Here

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

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

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

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

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

        IntVar var = VariableFactory.scale(VariableFactory.enumerated("b", new int[]{1, 2, 4}, solver), 2);
    if(!Configuration.ENABLE_VIEWS){
      try {
        // currently, the propagation is not sufficient (bound)
        // could be fixed with an extension filtering
        solver.propagate();
      }catch (Exception e){
        e.printStackTrace();
        throw new UnsupportedOperationException();
      }
    }
View Full Code Here

        IntVar var = VariableFactory.scale(VariableFactory.enumerated("b", new int[]{1, 2, 4}, solver), 2);
    if(!Configuration.ENABLE_VIEWS){
      try {
        // currently, the propagation is not sufficient (bound)
        // could be fixed with an extension filtering
        solver.propagate();
      }catch (Exception e){
        e.printStackTrace();
        throw new UnsupportedOperationException();
      }
    }
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.