[gecode-users] Fix IntVar value (MaximizeSpace::cost)
Pascal Francq (Mailing lists)
mailing-list at francq.info
Wed Jan 16 14:43:59 CET 2013
Hi,
I am using GeCode to find a set of parameters that maximize some
function. I inherit therefore from the class 'MaximizeSpace' class. The
problem is that the function to maximize isn't a direct combination of
the parameters determined by GeCode.
So, I need to rewrite the 'virtual IntVar cost(void) const;' method to
compute for each possible combination of the parameters the value of the
function to maximize. But here is my problem : I don't found how to
return this result in the function.
virtual MyClass::IntVar cost(void) const
{
int res(function(C)); // C is an 'IntVarArray'
IntVar ret=res; // <- Here is my problem !!!!!
return(ret);
}
Any idea ?
Thanks.
--
Dr. Pascal Francq
Belgium
More information about the users
mailing list