-
Notifications
You must be signed in to change notification settings - Fork 153
Fix bin packing initial propagation #1113
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
Conversation
solver/src/main/java/org/chocosolver/solver/constraints/nary/binPacking/PropBinPacking.java
Outdated
Show resolved
Hide resolved
… in PropBinPacking
| @Override | ||
| public void propagate(int evtmask) throws ContradictionException { | ||
| if(PropagatorEventType.isFullPropagation(evtmask)) { | ||
| for(int j = 0; j<nbAvailableBins; j++) { |
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.
to be 100% safe, P[j] and R[j] should be cleared here I think
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.
I agree, reifying this constraint could lead to unexpected results if P[j] and R[j] are not cleared.
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.
Yes, I agree it would be safer (and it is now done)
solver/src/main/java/org/chocosolver/solver/constraints/nary/binPacking/PropBinPacking.java
Outdated
Show resolved
Hide resolved
cprudhom
left a comment
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.
I agree with the correction, but it seems safer not to clean up P and R in full propagation.
Pull request has been modified.
db56caf to
5e6ab19
Compare
|
You mean, it would be safer to clean R and P in full propagation ? Or not clean them (as it is now) ? |
To set them to 0 as the first instruction of the |
* #1112 : fix bin packing initial propagation * move code initialising P and sumP from constructor to fullPropagation in PropBinPacking * clear R and P sets before full propagation in PropBinPacking
Fix bin packing's propagator initial propagation (described in #1112)