@Test(groups = "1s") public void testNextValueOut1() { Assert.assertEquals(b.nextValueOut(-2), -1); Assert.assertEquals(b.nextValueOut(-1), 2); Assert.assertEquals(b.nextValueOut(0), 2); Assert.assertEquals(b.nextValueOut(1), 2); Assert.assertEquals(b.nextValueOut(2), 3); }
@Override public int nextValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb - 1 <= v && v <= ub) { return ub + 1; } else { return v + 1; } }
EqView extends IntBoolView { @Override public int nextValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb - 1 <= v && v <= ub) { return ub + 1; } else { return v + 1; } } }
EqView extends IntBoolView { @Override public int nextValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb - 1 <= v && v <= ub) { return ub + 1; } else { return v + 1; } } EqView(final IntVar var, final int cste); }
EqView extends IntBoolView { @Override public int nextValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb - 1 <= v && v <= ub) { return ub + 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 nextValueOut(int v) { int lb = 0, ub = 1; if (!var.contains(cste)) { ub = 0; } else if (var.isInstantiated()) { lb = 1; } if (lb - 1 <= v && v <= ub) { return ub + 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);  }