Hi, The force/unforce members makes sure that the dispose-member is called when the Space is deleted. However, there are other circumstances where a propagator is disposed but the Space lives on. One such case is when a propagator is subsumed, another is when rewriting is done. In these cases the propagator should clean up after itself, for example by making sure to cancel subscriptions and returning any space-allocated memory. Unless you have references to external data, the kind of clean-up done in dispose is not necessary when a space is deleted.
Cheers, Mikael On Wed, Dec 3, 2008 at 1:28 PM, David Rijsman <[EMAIL PROTECTED]> wrote: > Hi Mikael, > > thanks, what is the use of BinaryPropagator::dispose if this class does not > register itself (it does not use force nor unforce)? > > David > >>>> > From: "Mikael Zayenz Lagerkvist" <[EMAIL PROTECTED]> > To: "David Rijsman" <[EMAIL PROTECTED]> > CC: <[EMAIL PROTECTED]> > Date: 12/3/2008 1:22 PM > Subject: Re: [gecode-users] Space::force and Space::unforce > > Hi, > > The functions force(Space*) and unforce(Space*) are members of the > Actor-class [1], and are used to register and deregister propagators > that have references to data that is external to the space. The > layered graph propagator, for example, has a reference to a DFA that > is shared. If a propagator does not register for deletion, then the > dispose-member will not be run when a space is deleted. > > Note that the members force(Space*) and unforce(Space*) will be > replaced in Gecode 3.0.0 with the more general Space-members notice > and ignore. > > Cheers, > Mikael > > [1] > http://www.gecode.org/gecode-doc-latest/classGecode_1_1Actor.html#e32f558bd1d470b3f9bbb8283a282678 > > On Wed, Dec 3, 2008 at 12:58 PM, David Rijsman > <[EMAIL PROTECTED]> wrote: >> I am implementing my own propagator and I am looking at different >> implementations. In LayeredGraph for example I see the use of Space::force >> and Space::unforce but in other propagators I do not see such a use. When >> should I use the force and unforce and for what purpose? >> >> thanks, >> >> David >> >> >> >> >> This message contains information that may be privileged or confidential and >> is the property of Quintiq. It is only intended for the person to whom it is >> addressed. If you are not the intended recipient, you are not authorized to >> read, print, retain, copy, disseminate, distribute or use this message or >> any part thereof. If you have received this message in error, please notify >> the sender immediately and delete all copies of this message. Please note >> that e-mails are susceptible to change, therefore they are not binding. >> >> _______________________________________________ >> Gecode users mailing list >> [EMAIL PROTECTED] >> https://www.gecode.org/mailman/listinfo/gecode-users >> > > > > -- > Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/ > > _______________________________________________ > Gecode users mailing list > [EMAIL PROTECTED] > https://www.gecode.org/mailman/listinfo/gecode-users > > > This message contains information that may be privileged or confidential and > is the property of Quintiq. It is only intended for the person to whom it is > addressed. If you are not the intended recipient, you are not authorized to > read, print, retain, copy, disseminate, distribute or use this message or any > part thereof. If you have received this message in error, please notify the > sender immediately and delete all copies of this message. Please note that > e-mails are susceptible to change, therefore they are not binding. > -- Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/ _______________________________________________ Gecode users mailing list [EMAIL PROTECTED] https://www.gecode.org/mailman/listinfo/gecode-users
