Skip to content

Conversation

@ArthurGodet
Copy link
Collaborator

Fix bin packing's propagator initial propagation (described in #1112)

@ArthurGodet ArthurGodet added the bug label Nov 9, 2024
@ArthurGodet ArthurGodet added this to the 4.11 milestone Nov 9, 2024
@ArthurGodet ArthurGodet requested a review from cprudhom November 9, 2024 11:01
@Override
public void propagate(int evtmask) throws ContradictionException {
if(PropagatorEventType.isFullPropagation(evtmask)) {
for(int j = 0; j<nbAvailableBins; j++) {
Copy link
Contributor

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

Copy link
Member

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.

Copy link
Collaborator Author

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)

Copy link
Member

@cprudhom cprudhom left a 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.

@mergify mergify bot dismissed cprudhom’s stale review November 12, 2024 09:00

Pull request has been modified.

@ArthurGodet
Copy link
Collaborator Author

You mean, it would be safer to clean R and P in full propagation ? Or not clean them (as it is now) ?

@cprudhom
Copy link
Member

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 for-loop (l.339)

@cprudhom cprudhom merged commit c78d3d9 into master Nov 12, 2024
cprudhom pushed a commit that referenced this pull request Aug 28, 2025
* #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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants