[gecode-users] Enumerating assignments removed by other propagatorssince last propagate call

Christian Schulte cschulte at kth.se
Tue Mar 27 19:40:29 CEST 2007


Hi,

Aaargh! Cloning appears to be tempting, indeed! You can not use cloning via
update or something like that: these routines only work during copying as
initiated by the copy function of a space where variables, propagators, etc
live in.

Currently, you will have to maintain your own copy. In Gecode 2.0, support
for being informed about removed values will be in place.

BTW: Gecode 2.0 goes steady and nicely, with already a substantial number of
improvements and new functionality. However, we will only finish after CP as
paper writing has preference for all of us.

Cheers
Christian

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Peter Tiedemann
Sent: Tuesday, March 27, 2007 6:32 PM
To: users at gecode.org
Subject: [gecode-users] Enumerating assignments removed by other
propagatorssince last propagate call


Hi,

Im trying to write an N-ary propagator that when propagating needs to do
some work for each assignment xi = a that was previously allowed but which
have now been pruned by another propagator.

As far as i can tell, Gecode doesnt maintain this information for me, so a
simple and reasonably efficient way to find this seems to maintain a clone
of the domain as it where in the previous call to propagate,  then for each
variable xi check if the domain size has changed, and if so iterate through
the old domain of xi, checking each value for membership in the new domain
for xi.

I have a added a ViewArray<IntView xOld to my propagator to be the copy of
the previous domains.

It would seem that all i have to do is to clone x in the beginning of the
very first propagate call, in the end of every propagate call and remember
to clone xOld when asked to clone the propagator. Is that correct?

If this is the right way to handle this, what is the correct way to clone
the ViewArray x/xOld? Should i use "xOld.update(home,false,x);", "xOld =
ViewArray<IntView>(home,x);" or something else entirely?

So far my attempts have caused some strange behavior, so im guessing that i
have misunderstood something :)

I could of course just implement my own lists of previously allowed
assignments, but i would like to understand what im doing wrong.

Regards,
Peter Tiedemann

_______________________________________________
Gecode users mailing list
users at gecode.org https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list