You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been trying to implement a validation of partial solutions in Choco. For that, I have been using the Solver.getEnvironment().worldPopUntil(0) and Solver.hardReset() methods to reset the solver at first and then look for complete solutions for partial validation.
More precisely, I stored in a collection the possible combinations of a subset of variables in my model (e.g. A={0..3} and B={0..3}). Then, for each partial solution {A, B}, which ones led to a complete solution (e.g. {A=0, B=1, C=2, D=2}) were identified and marked as valid. It works! However, the idea from now on is to validate partial solutions as soon as they are discovered (jointly), in the same solver instance, without having to hard reset, as we hope it will improve the performance.
Recently, I discovered that it is possible to perform a soft reset through the Solver.reset() method, which should allow returning to an intermediate state between 0 (rootWorldIndex) and the current one (getWorldIndex). However, whenever I use this method, it returns the worldIndex = 1. What I would expect to get would be: returning to a state with index w = 5 after performing a Solver.getEnvironment().worldPopUntil(w) and reset().
Any suggestions on how to resolve this?
I checked discussions #472, #490 and #491, but they don't express what exactly I'm looking for.
The text was updated successfully, but these errors were encountered:
miguelneto0
changed the title
Resetting solver to intermediate state
Resetting solver to an intermediate state
Apr 27, 2023
Hi, I have been trying to implement a validation of partial solutions in Choco. For that, I have been using the
Solver.getEnvironment().worldPopUntil(0)
andSolver.hardReset()
methods to reset the solver at first and then look for complete solutions for partial validation.More precisely, I stored in a collection the possible combinations of a subset of variables in my model (e.g.
A={0..3}
andB={0..3}
). Then, for each partial solution{A, B}
, which ones led to a complete solution (e.g.{A=0, B=1, C=2, D=2}
) were identified and marked as valid. It works! However, the idea from now on is to validate partial solutions as soon as they are discovered (jointly), in the same solver instance, without having to hard reset, as we hope it will improve the performance.Recently, I discovered that it is possible to perform a soft reset through the
Solver.reset()
method, which should allow returning to an intermediate state between 0 (rootWorldIndex) and the current one (getWorldIndex). However, whenever I use this method, it returns the worldIndex = 1. What I would expect to get would be: returning to a state with indexw = 5
after performing aSolver.getEnvironment().worldPopUntil(w)
andreset()
.Any suggestions on how to resolve this?
I checked discussions #472, #490 and #491, but they don't express what exactly I'm looking for.
The text was updated successfully, but these errors were encountered: