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
Fix bug in removeAllValuesBut and removeValues and for enumerated domain variables #1011
Conversation
solver/src/main/java/org/chocosolver/solver/variables/impl/BitsetArrayIntVarImpl.java
Outdated
Show resolved
Hide resolved
solver/src/main/java/org/chocosolver/solver/variables/impl/BitsetArrayIntVarImpl.java
Outdated
Show resolved
Hide resolved
solver/src/main/java/org/chocosolver/solver/variables/impl/BitsetIntVarImpl.java
Outdated
Show resolved
Hide resolved
solver/src/main/java/org/chocosolver/solver/variables/impl/BitsetArrayIntVarImpl.java
Outdated
Show resolved
Hide resolved
solver/src/main/java/org/chocosolver/solver/variables/impl/BitsetIntVarImpl.java
Outdated
Show resolved
Hide resolved
solver/src/main/java/org/chocosolver/solver/variables/view/IntView.java
Outdated
Show resolved
Hide resolved
Now that I look back to the code, I think there is a better alternative to while-loops. |
Pull request has been modified.
I finally let the code as is, I don't want the code to introduce to much code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the v and the c stand for in vlb/vub and clb/cub ?
Otherwise, seems fine to me !
I am not very inspired: |
Pull request has been modified.
I had this pernicious bug that occurs when the
removeAllValuesBut
method is called from for enumerated domain variables. This occurs when the variable is also monitored (here, a task) : the bounds was not up to date. Which led to inconcistency.To fix the bug, I encapsulate the internal
updateBounds
call in a loop to make sure that side effects (monitors or views) are capture at the right time.I also fix a bug in removeValues.