@Test(groups = "1s", timeOut = 60000) public void testJiTee2() { Constraint stickyCstr = null; Random rr = new Random(2); Model model = new Model("model"); IntVar load = model.intVar("load", new int[]{0, 100, 200, 300, 400, 500, 600, 700}); IntVar dim_A = model.intVar("dim_A", new int[]{150, 195, 270, 370, 470}); model.arithm(dim_A, "<=", 271).post(); model.arithm(load, ">", 400).post(); model.getEnvironment().worldPush(); int reqLoad = 0; for (int round = 0; round < 350; round++) { if (stickyCstr != null) { int r = rr.nextInt(100); if (r <= 12) { model.unpost(stickyCstr); stickyCstr = null; } } Constraint c; int reqInt = (round % 100) * 5; c = model.arithm(dim_A, ">", reqInt); c.post(); int r = 0; if (stickyCstr == null) { r = rr.nextInt(100); if (r <= 7) { stickyCstr = model.arithm(load, "=", r * 100); reqLoad = r * 100; model.post(stickyCstr); } } while (model.getSolver().solve()) { } Assert.assertEquals(model.getSolver().getSolutionCount() == 0, reqInt >= 270 || (stickyCstr != null && reqLoad < 500), "" + round); model.unpost(c); model.getEnvironment().worldPopUntil(0); model.getSolver().hardReset(); model.getEnvironment().worldPush(); } }
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);  }