[gecode-users] List of pruned values
Max Ostrowski
ostrowsk at cs.uni-potsdam.de
Fri Feb 3 09:58:55 CET 2012
Hi everybody,
i have to step into this discussion as i have similar demands ;)
I want to be notified whenever a boolean variable is assigned.
Currently i do this with a modified version of "wait". So i'm using a
propagator
that watches the boolean variable. It furthermore has a 4byte member
variable which
then says me which variable i do watch.
During propagation i then can add the changed variable to the list of
assigned variables.
I do not change the domain of anything.
Now my question:
Is it in this case more clever to use advisors? I do not need to
propagate, but as i'm not doing any propagation there should be no overhead.
Currently the performance of my systems suffers a bit because i have to
subscribe to every boolean variable.
Every propagator has a 4byte member. All this is copied during cloning
of a space, which happens quite often.
Can i avoid this using advisors?
Any idea how i can avoid copying the 4byte identifier of my propagator.
It is just used for the identification of which boolean variable i'm
subscribed to.
I do not need a copy of the propagator for each space.
Best,
Max
On 02/03/2012 09:07 AM, Guido Tack wrote:
> Hi Matthew,
>
> Gecode does not keep track of domain modifications on that level. The
> first thing I'd try is whether iterating through the variables is
> really too expensive. After all, checking whether the domain has
> changed is really cheap - just compare the domain sizes before and
> after (accessing them is constant time).
>
> If iteration is prohibitively expensive, you have to implement a
> custom propagator that doesn't implement a constraint but simply
> "listens" to domain modifications. It would be posted for all
> variables you're interested in, create advisors to be notified of
> modifications (so that it doesn't have to iterate), and simply record
> that information in an external data structure. It doesn't ever have
> to be scheduled for propagation. Our tutorial documentation should
> contain all the information to get you started. Note that this
> approach also incurs an overhead, because each modification needs to
> be recorded somewhere, but that's just unavoidable.
>
> Cheers,
> Guido
>
> On 3 Feb 2012, at 15:14, Matthew Kitching wrote:
>
>> Hi all,
>>
>> After calling "status" is it possible to get a list of all the domain
>> values pruned, or even a list of all the variables who had their
>> domains pruned? I am able to iterate through all variables and
>> compare their domains, but this is of course, not very fast.
>>
>> Thanks a lot,
>>
>> Matthew
>> _______________________________________________
>> Gecode users mailing list
>> users at gecode.org <mailto:users at gecode.org>
>> https://www.gecode.org/mailman/listinfo/gecode-users
>
> --
> Guido Tack, http://people.cs.kuleuven.be/~guido.tack/
> <http://people.cs.kuleuven.be/%7Eguido.tack/>
>
>
>
>
>
> _______________________________________________
> 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.gecode.org/pipermail/users/attachments/20120203/bd09d36d/attachment.htm>
More information about the users
mailing list