[gecode-users] A new variable composed by two IntVar

Guido Tack tack at ps.uni-sb.de
Sat Sep 26 18:08:02 CEST 2009


Hi,

if you just want to encapsulate two IntVars to make modeling easier,  
simply implement a wrapper class that forwards the relevant operations  
(such as update) to the two component variables.  There's nothing  
special about IntVars, they're plain C++ objects and you can put them  
in whatever other class you like.

Shouldn't Different_Point implement Px != Gx OR Py != Gy rather than  
AND?

Cheers,
	Guido

amina kemmar wrote:

> Hello,
>
> To model my problem, I need to use Point(x-coordinate, y- 
> coordinate), I can separate the point in two variables (IntVar), I  
> obtain:
>
> ...
> IntVar Px;
> IntVar Py;
>
> IntVar Gx;
> IntVar Gy;
>
> Different_Point(*this,Px,Py,Gx,Gy, ICL_DOM); // It is a new  
> constraint which post propagator for Px != Gx and Py != Gy
> ...
>
> I want to implement the variable PointVar to obtain a model like this:
>
> ...
> PointVar P;
> PointVar G;
> Different_Point(*this, P, G, ICL_DOM);
> ...
>
> This new variable is composed by two IntVar, I don't understand how  
> to implement it, if you can
> give me the first step to do this, or any documentation or  
> information about the implementation of a new variable?
>
> thank you,
> amina.
>
>
> Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows  
> Live ? Lancez-vous ! _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090926/0189d4b3/attachment.htm>


More information about the gecode-users mailing list