I have an array: array[backpacks] of int: capacity
specifying the capacity of each backpack.
Now I want to create an array of variables which the constraint solver will have to satisfy. I want each variable to take values in domain 1..capacity where capacity corresponds to the one specified in the above array.
Would something like this work: array[backpacks] of var capacity: bagcaps
?
Or do I have to do something like: array[backpacks] of var 1..MAX: bagcaps
and then add constraints: constraint forall(i in backpacks) bagcaps[i] <= capacity[i]
?
Thank you.