[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] print set of set
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] print set of set |
Date: |
Tue, 21 Feb 2012 13:06:20 +0300 |
> I'm trying to define a set of a set like the following:
>
> set Days;
> set SlotsOfDay{d in Days};
>
>
> and then in the data section:
>
> set TimeslotsOfDay[1] := 1..6;
This syntax is allowed only in the model section. In the data section
you need to specify all elements explicitly (because 1..6 is considered
as a literal "1..6"); for example:
set TimeslotsOfDay[1] := 1 2 3 4 5 6;
>
> so far I don't get any errors, but I can't print it, so I think it's not
> refined correctly.
>
> Is there any way?
>
printf{d in Days, t in SlotsOfDay[d]} "...", d, t, ... ;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Help-glpk] print set of set,
Andrew Makhorin <=