[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] [Fwd: need syntax help for parameter statement]
From: |
Andrew Makhorin |
Subject: |
[Help-glpk] [Fwd: need syntax help for parameter statement] |
Date: |
Sun, 13 May 2012 17:29:27 +0400 |
-------- Forwarded Message --------
From: spiritfire <address@hidden>
To: address@hidden
Subject: [Help-glpk] need syntax help for parameter statement
Date: Sun, 13 May 2012 03:10:20 -0700 (PDT)
Hi,
I'm trying to declare a parameter of that kind :
param TP 'Time preference' {i in N, k in M}, binary; # (with N = 1..4 and
M = 1..288)
The thing is that the values of my TP parameter should be easy to write
since it looks like this :
0,...,0,1,...,1,0,...,0
0,...,0,1,...,1,0,...,0
0,...,0,1,...,1,0,...,0
0,...,0,1,...,1,0,...,0
And I really don't want to write the 4x288 values !
Only the number of "1" and the location in the line is different for each
lines.
I tried this (I know it's quite ugly and wrong) :
param TP 'Time preference' {i in N, k in M}, binary :
if i=1 then (if (k<=96 or k>=216) then 1 else 0)
else (if i=2 then (if (k<=96 or k>=216) then 1 else 0)
else (if i=3 then (if (k<=96 or k>=216) then 1 else 0)
else (if i=4 then (if (k<=96 or k>=216) then 1 else 0)
) ) )
Any help is welcome,
Thank you.
- [Help-glpk] [Fwd: need syntax help for parameter statement],
Andrew Makhorin <=