@Test(groups = "1s") public void testPreviousValueOut2() throws ContradictionException { x.removeValue(3, Cause.Null); Assert.assertEquals(b.previousValueOut(10), 9); Assert.assertEquals(b.previousValueOut(2), 1); Assert.assertEquals(b.previousValueOut(1), -1); Assert.assertEquals(b.previousValueOut(0), -1); }
@Override public int previousValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb <= v && v <= ub + 1) { return lb - 1; } else { return v - 1; } }
EqView extends IntBoolView { @Override public int previousValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb <= v && v <= ub + 1) { return lb - 1; } else { return v - 1; } } }
EqView extends IntBoolView { @Override public int previousValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb <= v && v <= ub + 1) { return lb - 1; } else { return v - 1; } } EqView(final IntVar var, final int cste); }
EqView extends IntBoolView { @Override public int previousValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb <= v && v <= ub + 1) { return lb - 1; } else { return v - 1; } } EqView(final IntVar var, final int cste); @Override ESat getBooleanValue(); @Override boolean instantiateTo(int value, ICause cause); @Override int getDomainSize(); @Override boolean isInstantiated(); @Override boolean contains(int value); @Override boolean isInstantiatedTo(int value); @Override int getLB(); @Override int getUB(); @Override int nextValue(int v); @Override int nextValueOut(int v); @Override int previousValue(int v); @Override int previousValueOut(int v); @Override void justifyEvent(IntEventType mask, int one, int two, int three); @Override void explain(int p, ExplanationForSignedClause explanation); }
EqView extends IntBoolView { @Override public int previousValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb <= v && v <= ub + 1) { return lb - 1; } else { return v - 1; } } EqView(final IntVar var, final int cste); @Override ESat getBooleanValue(); @Override boolean instantiateTo(int value, ICause cause); @Override int getDomainSize(); @Override boolean isInstantiated(); @Override boolean contains(int value); @Override boolean isInstantiatedTo(int value); @Override int getLB(); @Override int getUB(); @Override int nextValue(int v); @Override int nextValueOut(int v); @Override int previousValue(int v); @Override int previousValueOut(int v); @Override void justifyEvent(IntEventType mask, int one, int two, int three); @Override void explain(int p, ExplanationForSignedClause explanation);  }