[gecode-users] Unary: Allow for negative durations when task is not mandatory

Roberto Castaneda Lozano rcas at kth.se
Fri Nov 1 09:45:55 CET 2013


Hi Andrea,

Interestingly enough I implemented for my own purposes a similar generalization to nooverlap a year ago, see the attachment.

Best regards,

Roberto

From: users-bounces at gecode.org [users-bounces at gecode.org] on behalf of Andrea Peano [andrea.peano at unife.it]
Sent: Thursday, October 31, 2013 12:50
To: Christian Schulte
Cc: users at gecode.org
Subject: Re: [gecode-users] Unary: Allow for negative durations when task is not mandatory

Yes, sure it's useful, thank you.
I'm just wondering whether a modification of the unary might be more efficient or not.
In such a case, I could modify the source files of Gecode, by adding another (modified) unary constraint, otherwise... should I write an user-defined propagator?

I've the same doubt regarding the nooverlap, I'd like to achieve a generalization of it.
In this generalization rectangles of the same "group" can overlap eachother, but they cannot overlap other rectangles of other groups.
So the new nooverlap will take in input an IntArgs array which contains the group IDs.

In your guide I read:
"The constraints [nooverlap] are implemented by a naive propagator (considering pairwise no-
overlap between rectangles including constructive disjunction, see also GCCAT: diffn),
this will change in the future. "

I could add a condition within the implementation of the nooverlap, that checks if the two rectangles belong to two different groups. Is it right?

Do you have any suggestion?

Thank you,
Andrea

On Wed, Oct 30, 2013 at 1:05 PM, Christian Schulte 
<cschulte at kth.se> wrote:

Hi,
 
There is a generic trick for situations like this: you introduce new variables tend', tstart' and tdur' and only enforce that they are equal to tend, tstart,
 tdur respectively when the Boolean variable is 1. That means if the Boolean variable is 0, the new variables can have whatever value.
 
Hope that helps
Christian
 
--
Christian Schulte, Professor of Computer Science, KTH,

www.ict.kth.se/~cschulte/
 

From:

users-bounces at gecode.org [mailto:users-bounces at gecode.org]
On Behalf Of Andrea Peano

Sent: Tuesday, October 29, 2013 10:21 AM

To: 
users at gecode.org

Subject: [gecode-users] Unary: Allow for negative durations when task is not mandatory


Hello all,

I would modify the unary constraint in order to allow negative durations (tend<tstart) when the boolvar m (mandatory) is 0.

Is there an easy way to do this?

Thank you,

Andrea

-- 




Andrea Peano - PhD student


Department of Engineering - University of Ferrara
Tel: +39 0532 97 4827




-------------- next part --------------
A non-text attachment was scrubbed...
Name: nocrossoverlap.zip
Type: application/zip
Size: 1856 bytes
Desc: nocrossoverlap.zip
URL: <http://www.gecode.org/pipermail/users/attachments/20131101/5173b133/attachment.zip>


More information about the users mailing list