On 8/31/07, Filip Konvička <[EMAIL PROTECTED]> 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/ _______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users
