[Top][All Lists]

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

Re: [Help-glpk] [Fwd: GLPK printing with if and iterative loop]

From: Oscar Gustafsson
Subject: Re: [Help-glpk] [Fwd: GLPK printing with if and iterative loop]
Date: Sat, 19 Feb 2011 22:40:55 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; sv-SE; rv: Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7


the following should work:

printf{i in Trainer, j4 in Course4, j5 in Course5, j6 in Course6: x4[i,j4] + x5[i,j5] + x6[i,j6] = 0} ...



Andrew Makhorin skrev 2011-02-19 22:26:
-------- Forwarded Message --------
From: Alan Zinober<address@hidden>
To: address@hidden
Subject: GLPK printing with if and iterative loop
Date: Sat, 19 Feb 2011 17:27:04 +0000

I need to print the Trainer names only when

       x4[i,j4] + x5[i,j5] + x6[i,j6] = 0

I declare:

set Trainer;           different trainer names

set Course4;         different course names
set Course5;         different course names
set Course6;         different course names

var x4{Trainer, Course4}>=0, binary;
var x5{Trainer, Course5}>=0, binary;
var x6{Trainer, Course6}>=0, binary;

Essentially I need a print statement with the logic of the code below
but do not know how to set up
j4 iterated on Course 4, j5 iterated on Course5, j6 iterated on Course6 :

for {i in Trainer}

       printf (if x4[i,j4 iterated on Course4] + x5[i,j5 iterated on
Course 5]
                            + x6[i,j6 iterated on Course6] =0 then  "%s


Help-glpk mailing list

reply via email to

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