-------- Forwarded Message --------
From: spiritfire <[email protected]>
To: [email protected]
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 mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to