[gecode-users] questions in integer n-ary linear with advisor

Pengyu Zhao zpengyu at gmail.com
Mon Nov 26 01:07:23 CET 2007


hi,

I have a question about "advisor".

I am writing an advisor for n-ary linear equation.

In n-ary Eq(trunk/gecode/int/linear.hh), the template class definition
is:
	template<class Val, class P, class N>
	class Eq : public Lin<Val,P,N,PC_INT_BND> {......}
"P" represented for position view array.
"N" represented for negative view array or NoView.
Then, I added a council to this propagator, like,
	Council<LinearAdvisor<V>> council;
I added a "LinearAdvisor" class which derived from "ViewAdvisor<V>",like
	template<class V>
	class LinearAdvisor : public ViewAdvisor<V> {......}
when constructing, the council and Advisors of variables only accept ONE
template parameter like P or N. But, the type of views in a propagator
may different, is there another way to set an advisor to a view
dynamically? How can I make a council accept different kinds of
advisors?
I have tried to set V to DoubleView, it's ok but coefficient can only
accept 1 or -1.
Also, the propagator only accept one Council.

Thank you very much.


-- 
Best Regards,
Pengyu ZHAO

pengyu(a)kth.se
+46(0)762 319 744





More information about the gecode-users mailing list