[gecode-users] Initializing domain of IntegerVars

Max Ostrowski ChaosAngel at gmx.de
Mon Jul 18 10:21:27 CEST 2011


Hello,

currently i have to create some IntegerVariables and some constraints, and i'm doing this using the IntVar/2 constructor, restricting the variables domain.

Due to some design decisions it could be necessary to change this to something like:

IntVar x(*this, MIN_INT,MAX_INT);
dom(*this, x,2,12);
or worse
BoolVar a,b;
dom(*this, x,2,12, a);
dom(*this, x,24,42, b);
rel(*this, a, BOT_OR, b, 1).


Afterwards i will do post further constraints and do search.
Is this bad in terms of performance, and if, why.

(I can understand that i have to post the dom constraint first, because sending a constraint already does some propagation.
Furthermore: does the second variant (with the BOT_OR) also restrict the domain of the variable?)

Best,
Max


-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



More information about the users mailing list