Sweep based DiffN Propagator#195
Conversation
…s seems to be an issue
…s seems to be an issue
….rs to comply with the latest changes in huub
|
Sorry for the delay, this should fix everything we discussed during the meeting! :D What has been added:
|
|
Sorry that this took a lot longer than it probably should have. I finally freed up some time to refactor the code base. I've updated it to the latest changes in the solver, and I've made a few changes to the data structures. (I think I put you on the wrong track with the @dannem1337, I would appreciate it if you could have another look through the codebase, just to see whether there are any obvious problems that you can find or whether there are any misunderstandings that made it into the documentation. Afterwards, I think this will be ready to merge. |
|
A bug seems to have been introduced in 683c6a6 that didn't exist before The following model gives a result where some rectangles are overlapping, my guess is that is that something something is wrong when checking conflict. I will continue to investigate this tomorrow include "diffn.mzn";
int: n = 14;
int: maxLen = 100;
array[1..n] of 1..n: Squares = [i | i in 1..n];
var n..maxLen: w;
var n..maxLen: h;
var int: rec = w*h;
array [1..n] of var 0..maxLen: X;
array [1..n] of var 0..maxLen: Y;
constraint forall(i in 1..n) (X[i] <= w-Squares[i] /\ Y[i] <= h-Squares[i]);
constraint diffn(X, Y, Squares, Squares);
solve minimize rec;
output ["w:\(w) h:\(h) X:\(X) Y:\(Y) rec: \(rec) squares: \(Squares)"]; |
|
Great catch! I think I found the problem. It appears that I thought that I rewrote That initially gave me the overlap, and after the fix no longer does. (I didn't have the fancy visualizations). |
CervEdin
left a comment
There was a problem hiding this comment.
- a possible bug identified
- a possible fix of TODO proposed
also, fixed a typo here:
dannem1337#3

A Sweep based DiffN Propagator created within this master thesis.
What's been added
TODOs
all_fringenerate_frcould be moved to self to reduce the number of allocations