You'll find the instructions in the user guide tagged 3.2.1, p49-52.
But keep in mind that the explained propagators are, for the moment, limited to unary, binary and ternary ones. Moreover, explaining that a problem has no solution required to plug explanation in AND a complete search process. Thus, the resolution can take time.
Thank you for your help
I have tried this code:
solver.set(new RecorderExplanationEngine(solver));
ConflictBasedBackjumping cbj = new ConflictBasedBackjumping(solver.getExplainer());
// Then active end-user explanation
cbj.activeUserExplanation(true);
if(!solver.findSolution()){
// If the problem has no solution, the end-user explanation can be retrieved
System.out.println(cbj.getUserExplanation());
}
But, I had this message activeUserExplanation and getUserExplanation are not defined for ConflictBasedBackjumping
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yep, as explained, you need to set the property PROP_IN_EXP to true.
To do so, if you work with the sources, simply modify the configuration.properties in choco3/choco-solver/src/main/resources/.
If you work with the jar file, create a file named user.properties and simply add the following property: PROP_IN_EXP = true. Then move it the root directory of your project.
Hope it helps,
CP
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I downloaded this jar: "choco-solver-3.2.0-jar-with-dependencies.jar", I added this jar to my project, I created a file named user.properties and added the following property: PROP_IN_EXP = true.
However, I had this compilation problem: the method activeUserExplanation(boolean) is not defined for the type ConflictBasedBackjumping.
Thank you for your help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
How to use explanation in choco3 to know why a problem has no solution?
Thanks
Hi,
You'll find the instructions in the user guide tagged 3.2.1, p49-52.
But keep in mind that the explained propagators are, for the moment, limited to unary, binary and ternary ones. Moreover, explaining that a problem has no solution required to plug explanation in AND a complete search process. Thus, the resolution can take time.
The work on explanations is still in progress.
Hope it helps,
CP
NB: please, go to https://github.com/chocoteam/choco3 to post questions relative to choco3.
Thank you for your help
I have tried this code:
solver.set(new RecorderExplanationEngine(solver));
ConflictBasedBackjumping cbj = new ConflictBasedBackjumping(solver.getExplainer());
// Then active end-user explanation
cbj.activeUserExplanation(true);
if(!solver.findSolution()){
// If the problem has no solution, the end-user explanation can be retrieved
System.out.println(cbj.getUserExplanation());
}
But, I had this message activeUserExplanation and getUserExplanation are not defined for ConflictBasedBackjumping
Yep, as explained, you need to set the property
PROP_IN_EXP
totrue
.To do so, if you work with the sources, simply modify the
configuration.properties
inchoco3/choco-solver/src/main/resources/
.If you work with the jar file, create a file named
user.properties
and simply add the following property:PROP_IN_EXP = true
. Then move it the root directory of your project.Hope it helps,
CP
Hi,
I downloaded this jar: "choco-solver-3.2.0-jar-with-dependencies.jar", I added this jar to my project, I created a file named user.properties and added the following property: PROP_IN_EXP = true.
However, I had this compilation problem: the method activeUserExplanation(boolean) is not defined for the type ConflictBasedBackjumping.
Thank you for your help
That's because you downloaded the wrong jar.
You should dl v3.2.1.
The jar file has changed, it is now simply
choco-solver-3.2.1.jar
Hope it helps,
CP
NB: please, go to https://github.com/chocoteam/choco3 to post questions relative to choco3.