[gecode-users] problame when find the optima solution

Mikael Zayenz Lagerkvist zayenz at gmail.com
Thu Feb 14 12:06:33 CET 2008


2008/2/14 ruanzheng <ruanzheng2377 at hotmail.com>:
> I override the "constrain" function to get the optima solution. But when I
> try to get some IntVar variables of the space in the function,
> a runtime error occurs, it says I  try to get the value of some unassigned
> IntVar variable.
> What's the possible mistake of my code?

That you try to access the value (using the val() member function) of
a variable that is not assigned. Check that you are accessing the
value of a variable form the right space, and that the variable should
in fact be assigned (you have all the branchings that are needed).

Cheers,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list