@Test(groups = "1s", timeOut = 60000, dataProvider = "unpost") public void testUnpost(String op) { Model m = new Model(); { IntVar[] M = m.intVarArray("M", 3, 0, 2, false); BoolVar[][] choice = m.boolVarMatrix("choice", 3, 3); for (int i = 0; i < 3; i++) { m.boolsIntChanneling(choice[i], M[i], 0).post(); } m.arithm(M[0], "=", 0).post(); m.arithm(M[1], "=", 0).post(); m.getSolver().setSearch(Search.inputOrderLBSearch(M)); m.getSolver().findAllSolutions(); } Model m2 = new Model(); { IntVar[] M = m2.intVarArray("M", 3, 0, 2, false); BoolVar[][] choice = m2.boolVarMatrix("choice", 3, 3); for (int i = 0; i < 3; i++) { m2.boolsIntChanneling(choice[i], M[i], 0).post(); } m2.arithm(M[0], "=", 0).post(); m2.arithm(M[1], "=", 0).post(); Constraint c2 = m2.arithm(M[2], op, M[1]); c2.post(); m2.unpost(c2); m2.getSolver().setSearch(Search.inputOrderLBSearch(M)); m2.getSolver().findAllSolutions(); } assertEquals(m.getSolver().getSolutionCount(), m2.getSolver().getSolutionCount()); }
public final void post() { propagators[0].getModel().post(this); }
Constraint { public final void post() { propagators[0].getModel().post(this); } }
Constraint { public final void post() { propagators[0].getModel().post(this); } Constraint(String name, Propagator... propagators); }
Constraint { public final void post() { propagators[0].getModel().post(this); } Constraint(String name, Propagator... propagators); Propagator[] getPropagators(); Propagator getPropagator(int i); ESat isSatisfied(); String toString(); final boolean isReified(); void reifyWith(BoolVar bool); final BoolVar reify(); final void post(); final void ignore(); final void declareAs(Status aStatus, int idx); final void checkNewStatus(Status aStatus); final Status getStatus(); int getCidxInModel(); Constraint getOpposite(); void setName(String newName); String getName(); PropagatorPriority computeMaxPriority(); static Constraint merge(String name, Constraint... toMerge); }
Constraint { public final void post() { propagators[0].getModel().post(this); } Constraint(String name, Propagator... propagators); Propagator[] getPropagators(); Propagator getPropagator(int i); ESat isSatisfied(); String toString(); final boolean isReified(); void reifyWith(BoolVar bool); final BoolVar reify(); final void post(); final void ignore(); final void declareAs(Status aStatus, int idx); final void checkNewStatus(Status aStatus); final Status getStatus(); int getCidxInModel(); Constraint getOpposite(); void setName(String newName); String getName(); PropagatorPriority computeMaxPriority(); static Constraint merge(String name, Constraint... toMerge);  }