Hi,
i am trying to use choco3 (3.1.1) in an interactive setting and want to give a message to the user, whenever he/she sets an value that can not lead to a solution (but may be part of the current domain). How can i retract the last posted constraint and all it's consequences.
The only method i found is to rebuild the whole model.
// user sets x = 1 (part of current domain)
solver.post(IntConstraintFactory.arithm(x,"=",1));
try {
solver.propagate();
// or solver.findSolution() for full consistency check
} catch (ContradictionException e) {
// undo x=1 ?
// message to user x=1 is inconsistent
}
// alternatively
// if (!solver.findSolution()) // undo x=1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
i am trying to use choco3 (3.1.1) in an interactive setting and want to give a message to the user, whenever he/she sets an value that can not lead to a solution (but may be part of the current domain). How can i retract the last posted constraint and all it's consequences.
The only method i found is to rebuild the whole model.
// user sets x = 1 (part of current domain)
solver.post(IntConstraintFactory.arithm(x,"=",1));
try {
solver.propagate();
// or solver.findSolution() for full consistency check
} catch (ContradictionException e) {
// undo x=1 ?
// message to user x=1 is inconsistent
}
// alternatively
// if (!solver.findSolution()) // undo x=1