[gecode-users] assigning IntVars

Guido Tack tack at ps.uni-sb.de
Mon Sep 14 19:26:02 CEST 2009


Tarek Garoui wrote:
> I created an IntVar like this:
>
> IntVar id = new IntVar(this, "ID", new Integer(0), new Integer(max));
>
> After that, I want to post a constraint consisting of a BExpr where  
> I need the value of the IntVar id. But I get the following exception:
> org.gecode.NotAssigned.
>
> How can I assign values to an IntVar ?

You initialized the variable with a domain 0..max, so it's clearly not  
assigned.  It will be assigned by search, of course, but you cannot  
use the final value in your model.

Cheers,
	Guido





More information about the gecode-users mailing list