On Sun, Oct 26, 2008 at 5:22 AM, David Przybilla <[EMAIL PROTECTED]> wrote: > In gecode 1 it was possible to use BoolVars and IntVars interchangeably, > that means that a function which received a BoolVar could receive an Intvar > and a function which received an IntVar could received a BoolVar as an > argument.
This change was made so that BoolVar's could be implemented more efficiently - the memory requirements went down with about 50% and the efficiency went up. For constraints that make sense for Booelan variables, there are now post-functions that take BoolVar's instead of IntVar's. > Im porting a library from gecode 1 to Gecode 2 > The solution I had found for these function callings is to create a new > variable and post a channeling constraint > I wonder if there is another way to achieve this, and if posting this new > constraint would affect the performance. The channeling constraints are very cheap to propagate. However, in most cases they should not be needed, since there are dedicated propagators for constraints over Booleans which are more efficient than the ones for integer variables. If possible, make sure that you use the appropriate propagator for the type of variable that you have. Cheers, Mikael -- Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/ _______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users