@Test(groups="1s", timeOut=60000, expectedExceptions = ContradictionException.class) public void testUpdBounds5() throws ContradictionException { Model model = new Model(); IntVar x = model.boolVar(); x.updateBounds(4, -2, Cause.Null); }
@Override public boolean updateBounds(int lb, int ub, ICause cause) throws ContradictionException { boolean hasChanged = false; if (lb > kTRUE || ub < kFALSE) { model.getSolver().getEventObserver().instantiateTo(this, 2, cause, kFALSE, kTRUE); this.contradiction(cause, MSG_UNKNOWN); } else { if (lb == kTRUE) { hasChanged = instantiateTo(kTRUE, cause); } else if (ub == kFALSE) { hasChanged = instantiateTo(kFALSE, cause); } } return hasChanged; }
BoolVarImpl extends AbstractVariable implements BoolVar { @Override public boolean updateBounds(int lb, int ub, ICause cause) throws ContradictionException { boolean hasChanged = false; if (lb > kTRUE || ub < kFALSE) { model.getSolver().getEventObserver().instantiateTo(this, 2, cause, kFALSE, kTRUE); this.contradiction(cause, MSG_UNKNOWN); } else { if (lb == kTRUE) { hasChanged = instantiateTo(kTRUE, cause); } else if (ub == kFALSE) { hasChanged = instantiateTo(kFALSE, cause); } } return hasChanged; } }
BoolVarImpl extends AbstractVariable implements BoolVar { @Override public boolean updateBounds(int lb, int ub, ICause cause) throws ContradictionException { boolean hasChanged = false; if (lb > kTRUE || ub < kFALSE) { model.getSolver().getEventObserver().instantiateTo(this, 2, cause, kFALSE, kTRUE); this.contradiction(cause, MSG_UNKNOWN); } else { if (lb == kTRUE) { hasChanged = instantiateTo(kTRUE, cause); } else if (ub == kFALSE) { hasChanged = instantiateTo(kFALSE, cause); } } return hasChanged; } BoolVarImpl(String name, Model model); }
BoolVarImpl extends AbstractVariable implements BoolVar { @Override public boolean updateBounds(int lb, int ub, ICause cause) throws ContradictionException { boolean hasChanged = false; if (lb > kTRUE || ub < kFALSE) { model.getSolver().getEventObserver().instantiateTo(this, 2, cause, kFALSE, kTRUE); this.contradiction(cause, MSG_UNKNOWN); } else { if (lb == kTRUE) { hasChanged = instantiateTo(kTRUE, cause); } else if (ub == kFALSE) { hasChanged = instantiateTo(kFALSE, cause); } } return hasChanged; } BoolVarImpl(String name, Model model); @Override boolean removeValue(int value, ICause cause); @Override boolean removeValues(IntIterableSet values, ICause cause); @Override boolean removeAllValuesBut(IntIterableSet values, ICause cause); @Override boolean removeInterval(int from, int to, ICause cause); @Override boolean instantiateTo(int value, ICause cause); @Override boolean updateLowerBound(int value, ICause cause); @Override boolean updateUpperBound(int value, ICause cause); @Override boolean updateBounds(int lb, int ub, ICause cause); @Override boolean setToTrue(ICause cause); @Override boolean setToFalse(ICause cause); @Override boolean isInstantiated(); @Override boolean isInstantiatedTo(int aValue); @Override boolean contains(int aValue); @Override int getValue(); @Override ESat getBooleanValue(); @Override int getLB(); @Override int getUB(); @Override int getDomainSize(); @Override int getRange(); @Override int nextValue(int v); @Override int nextValueOut(int v); @Override int previousValue(int v); @Override int previousValueOut(int v); @Override boolean hasEnumeratedDomain(); @Override IEnumDelta getDelta(); @Override String toString(); @Override void createDelta(); @SuppressWarnings("unchecked") @Override IIntDeltaMonitor monitorDelta(ICause propagator); @Override int getTypeAndKind(); @Override DisposableValueIterator getValueIterator(boolean bottomUp); @Override DisposableRangeIterator getRangeIterator(boolean bottomUp); @Override Iterator<Integer> iterator(); @Override void _setNot(BoolVar neg); @Override BoolVar not(); @Override boolean hasNot(); @Override boolean isLit(); @Override boolean isNot(); @Override void setNot(boolean isNot); @Override void createLit(IntIterableRangeSet rootDomain); @Override SignedLiteral getLit(); }
BoolVarImpl extends AbstractVariable implements BoolVar { @Override public boolean updateBounds(int lb, int ub, ICause cause) throws ContradictionException { boolean hasChanged = false; if (lb > kTRUE || ub < kFALSE) { model.getSolver().getEventObserver().instantiateTo(this, 2, cause, kFALSE, kTRUE); this.contradiction(cause, MSG_UNKNOWN); } else { if (lb == kTRUE) { hasChanged = instantiateTo(kTRUE, cause); } else if (ub == kFALSE) { hasChanged = instantiateTo(kFALSE, cause); } } return hasChanged; } BoolVarImpl(String name, Model model); @Override boolean removeValue(int value, ICause cause); @Override boolean removeValues(IntIterableSet values, ICause cause); @Override boolean removeAllValuesBut(IntIterableSet values, ICause cause); @Override boolean removeInterval(int from, int to, ICause cause); @Override boolean instantiateTo(int value, ICause cause); @Override boolean updateLowerBound(int value, ICause cause); @Override boolean updateUpperBound(int value, ICause cause); @Override boolean updateBounds(int lb, int ub, ICause cause); @Override boolean setToTrue(ICause cause); @Override boolean setToFalse(ICause cause); @Override boolean isInstantiated(); @Override boolean isInstantiatedTo(int aValue); @Override boolean contains(int aValue); @Override int getValue(); @Override ESat getBooleanValue(); @Override int getLB(); @Override int getUB(); @Override int getDomainSize(); @Override int getRange(); @Override int nextValue(int v); @Override int nextValueOut(int v); @Override int previousValue(int v); @Override int previousValueOut(int v); @Override boolean hasEnumeratedDomain(); @Override IEnumDelta getDelta(); @Override String toString(); @Override void createDelta(); @SuppressWarnings("unchecked") @Override IIntDeltaMonitor monitorDelta(ICause propagator); @Override int getTypeAndKind(); @Override DisposableValueIterator getValueIterator(boolean bottomUp); @Override DisposableRangeIterator getRangeIterator(boolean bottomUp); @Override Iterator<Integer> iterator(); @Override void _setNot(BoolVar neg); @Override BoolVar not(); @Override boolean hasNot(); @Override boolean isLit(); @Override boolean isNot(); @Override void setNot(boolean isNot); @Override void createLit(IntIterableRangeSet rootDomain); @Override SignedLiteral getLit();  }