}
}
@Override
public void explain(Deduction d, Explanation e) {
throw new SolverException("A task cannot explain itself yet.");
}
};
} else {
update = new IVariableMonitor() {
@Override
public void onUpdate(Variable var, IEventType evt) throws ContradictionException {
// start
start.updateLowerBound(end.getLB() - duration.getUB(), this);
start.updateUpperBound(end.getUB() - duration.getLB(), this);
// end
end.updateLowerBound(start.getLB() + duration.getLB(), this);
end.updateUpperBound(start.getUB() + duration.getUB(), this);
// duration
duration.updateLowerBound(end.getLB() - start.getUB(), this);
duration.updateUpperBound(end.getUB() - start.getLB(), this);
}
@Override
public void explain(Deduction d, Explanation e) {
throw new SolverException("A task cannot explain itself yet.");
}
};
}
start.addMonitor(update);