[gecode-users] algorithm used in sequence constraint

David Rijsman David.Rijsman at quintiq.com
Thu Aug 19 15:53:12 CEST 2010


Hi Kish,

IntSet can only take values 0 and 1 otherwise a NotZeroOne exception will be thrown (actually undocumented I see now) . If both values are in IntSet nothing needs to be done if l equals 0 and u is greater or equal to q, if this is not the case the constraint can not be true. I don't map the more integer version onto 1 (boolean version)  but the boolean version on the integer version, basically one implementation independent of (bool or integer) view and type of variable. 

hope this helps,

David

>>> 
From: 	Kish Shen <kisshen at cisco.com>
To:	David Rijsman <David.Rijsman at quintiq.com>
CC:	<users at gecode.org>
Date: 	8/19/2010 3:21 PM
Subject: 	Re: [gecode-users] algorithm used in sequence constraint

David Rijsman wrote:
> Hi Kish,
> 
> it is indeed possible to remove the IntSet s argument in the sequence constraint for boolean variables but we choose to explicitly state what value we are counting and use the IntSet for the following reason, I quote from Christian:
> 
> "we never use the C++ type bool for Boolean values as Boolean variables also take integer values. And also  choosing a set makes it easier to interface and just forget about the fact whether one is using IntVar or BoolVar."
> 
> David
> 
Hi David,

So I assume the IntSet s can only take the values 0 and 1 for the 
BoolVar case, and is really only useful if it has either 1 or 0 only? 
[If it has both 0 and 1, then all variables must take those values]

In the ECLiPSe version, there seems to be a more fundamental reason why 
the 0/1 (ECLiPSe 'boolean' version) version counts 1 -- the algorithm is 
implemented using this version, i.e. the more general version is 
actually mapped onto the 0/1 version. Is this also the case in your 
version?

Thanks and cheers,

Kish
-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.




More information about the users mailing list