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, cschu...@kth.se Expert Researcher, RISE SICS, christian.schu...@ri.se -----Original Message----- From: users-boun...@gecode.org <users-boun...@gecode.org> On Behalf Of Sebastian Albert Sent: 24 March 2018 19:54 To: users@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@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users