[gecode-users] Distinguishing advisors by pointer or reference?

Christian Schulte cschulte at kth.se
Mon Mar 26 10:53:14 CEST 2018


I would not keep a reference or pointer as they are messy to update during cloning. I would store the required information inside the advisor, for example an integer index or the view itself. The latter idea is used quite extensively in Gecode, sometimes one does not even need an array of views any longer as the views are stored inside the advisors.

Hope that helps.

Cheers
Christian

--
Christian Schulte, https://chschulte.github.io/
Professor of Computer Science, KTH, cschulte at kth.se
Expert Researcher, RISE SICS, christian.schulte at ri.se

-----Original Message-----
From: users-bounces at gecode.org <users-bounces at gecode.org> On Behalf Of Sebastian Albert
Sent: 24 March 2018 19:54
To: users at gecode.org
Subject: [gecode-users] Distinguishing advisors by pointer or reference?

Dear list

I'm currently trying to get started with Advisors, and I'm wondering what would be the correct way to go.

I have a propagator with four different IntViews that play different roles, and I want to use advisors to tell which one has changed. Can I keep references to them in my propagator object and compare these to the advisor passed into the advise function? How should I go about this?

The two examples in MPG are sort of special and do not seem to do that, since the first one only has advisors for variables playing the same role, and the second one has only one, inferring the different roles from the variable types (boolean vs. integer).

Thanks
Sebastian

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


More information about the users mailing list