/**
* Iterate over removed values to explain the objective variable state
*/
private void readAntiDomain() {
AntiDomain adObj = mExplanationEngine.getRemovedValues(objective);
DisposableValueIterator it = adObj.getValueIterator();
clusters.add(0);
// 2'. compute bounds to avoid explaining the whole domain
boolean ismax = om.getPolicy() == ResolutionPolicy.MAXIMIZE;
int far, near;
if (ismax) {
far = UB;
near = objective.getValue() + 1;
if (far == objective.getValue()) {
return;
}
} else {
far = LB;
near = objective.getValue() - 1;
if (far == objective.getValue()) {
return;
}
}
int value;
if (ismax) {
// explain why obj cannot take a smaller value: from far to near
if (it.hasNext()) {
do {
value = it.next();
} while (it.hasNext() && (value < near || value > far)); // skip {LBs} and {UBs before init propag}
do {
explainValue(value);
} while (it.hasNext() && (value = it.next()) >= near);
}
} else {
// explain why obj cannot take a smaller value: from far to near
if (it.hasNext()) {
do {
value = it.next();
} while (it.hasNext() && value < far);// skip {LBs before init propag}
do {
explainValue(value);
} while (it.hasNext() && (value = it.next()) <= near);
}
}
it.dispose();
}