[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] K must be subscripted
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] K must be subscripted |
Date: |
Wed, 04 Jul 2012 14:51:54 +0400 |
> i have this situation:
> ....
> set SLA;
>
> set K{t in SLA};
>
> param Deadline{t in SLA} ;
>
> subject to DLINE{i in SLA}: sum{t in K} x[i,t]=1 ;
> ....
>
> data;
>
> set SLA := A17 A18 A25 ;
>
> set K:= 0..Deadline ;
>
> param Deadline :=
>
> A17 32
> A18 40
> A25 44 ;
> ...
>
> end;
>
> but i get this error: K must be subscripted
>
> how can i solve this error??
>
No operators are allowed in the data section. Thus,
set K:= 0..Deadline ;
means specifying a plain set K that consists of the only element, which
is a string literal "0..Deadline". However, the error occurs because K
is declared as a set (array) of sets rather a plain set.
Please look at examples in the language reference and those included in
the glpk distribution.