[gecode-users] branchings methods Space* arguments

Mikael Zayenz Lagerkvist zayenz at gmail.com
Fri Aug 31 11:22:04 CEST 2007


On 8/31/07, Filip Konvička <filip.konvicka at logis.cz> wrote:
> Hi,
>
> my new propagators run just fine :-) Now I wanted to do create a
> branching, and I don't understand why status(), descrption() and
> commit() take the "Space *home" parameter. I thought that a branching is
> bound to "its" space in the constructor, and that it would always
> operate on that space. I also thought that it would, in the constructor
> or in the post() function, create some views of some variables in the
> space, and operate on them instead of accessing the space directly. In
> fact, the same holds for propagators as well.
>
> Can you explain, please?

While propagators and branchings (collectively called actors) do
belong to a specific Space, they do not have this information stored.
Instead, the associated Space of an actor is passed as a dynamic scope
in calls to it. As for (views of) variables, they also do not contain
a reference to their associated Space.

The normal style for an actor is to, indeed, create some views in the
post-function and use these. For example, the Space argument is needed
to schedule propagators when a tell is made. It is also needed when
one needs to allocate memory from the Space-managed heap.

Hope this helps,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/


More information about the gecode-users mailing list