A question about tuples

Luis Quesada l.quesada at 4c.ucc.ie
Thu Aug 9 23:30:31 CEST 2007


mostafa eslahi wrote:
> Hi,
> I'm new in mozart and have only a simple problem.
> How can I introduce a fd list(or tuple) with different domains?
> For example, I'd like to introduce a tuple with this properties:
> number of variables = 5
> Domain of variable 1 = [1 3 5]
> .
> .
> .
> Domain of variable 5 = [ 3 6 10 15]
> but I couldn't use {FD.tuple index 5 +spec name}.
> Thanks
Create the list of variables and the list of domains separately. Then 
associate each variable with its domain:

declare
Vars={List.make 10}
Doms=for I in 1..10 collect:C do {C 1#10+I} end
for X in Vars D in Doms do X::D end
{Show Vars}

Cheers,
Luis


More information about the mozart-users mailing list