Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resetting solver to an intermediate state #1028

Open
miguelneto0 opened this issue Apr 27, 2023 · 0 comments
Open

Resetting solver to an intermediate state #1028

miguelneto0 opened this issue Apr 27, 2023 · 0 comments

Comments

@miguelneto0
Copy link

miguelneto0 commented 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) 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.

@miguelneto0 miguelneto0 changed the title Resetting solver to intermediate state Resetting solver to an intermediate state Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant