@Test(groups = "1s") public void testPreviousValue2() throws ContradictionException { x.updateUpperBound(3, Cause.Null); Assert.assertEquals(b.previousValue(10), 1); Assert.assertEquals(b.previousValue(2), 1); Assert.assertEquals(b.previousValue(1), Integer.MIN_VALUE); Assert.assertEquals(b.previousValue(0), Integer.MIN_VALUE); }
@Override public int previousValue(int v) { if (v > 1 && contains(1)) { return 1; } return v >= 1 && contains(0) ? 0 : Integer.MIN_VALUE; }
LeqView extends IntBoolView { @Override public int previousValue(int v) { if (v > 1 && contains(1)) { return 1; } return v >= 1 && contains(0) ? 0 : Integer.MIN_VALUE; } }
LeqView extends IntBoolView { @Override public int previousValue(int v) { if (v > 1 && contains(1)) { return 1; } return v >= 1 && contains(0) ? 0 : Integer.MIN_VALUE; } LeqView(final IntVar var, final int cste); }
LeqView extends IntBoolView { @Override public int previousValue(int v) { if (v > 1 && contains(1)) { return 1; } return v >= 1 && contains(0) ? 0 : Integer.MIN_VALUE; } LeqView(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); }
LeqView extends IntBoolView { @Override public int previousValue(int v) { if (v > 1 && contains(1)) { return 1; } return v >= 1 && contains(0) ? 0 : Integer.MIN_VALUE; } LeqView(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);  }