help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Re: glpk/l parametric lead lag


From: Andrew Makhorin
Subject: [Help-glpk] Re: glpk/l parametric lead lag
Date: Fri, 31 Jan 2003 17:17:26 +0300

>Does anybody know how to perform a lag or lead with a paramtric jump in
>glpk/l :
>
>set S = (t1,t2,t3,t4,t5,t6);
>
>C[s] := X[s]<=X[s-1]; /* OK
>C[s] := X[s]<=X[s-2]; /* OK
>
>lag:=2;
>C[s] := X[s]<=X[s-lag]; /* KO

The last statement is syntactically incorrect, because the offset can
be an integer constant only. Undoubtely this restriction is a defect of
the language.

>My workaround is to define an index on S and use it like this :
>
>set S = (t1,t2,t3,t4,t5,t6);
>    parameter _iS[S];
>    _iS[s] := data (s in S: t1 1,t2 2,t3 3,t4 4,t5 5,t6 6);
>
>lag:=2;
>
>C[s] := X[s] <= sum(t, X[t] where _iS[t]-_iS[s]+lag=0 );
>
>Is there anything simpler ?

Probably this is the only way to attain the effect you need.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]