help-glpk
[Top][All Lists]
Advanced

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

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


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: GLPK printing with if and iterative loop]
Date: Sun, 20 Feb 2011 00:26:18 +0300

-------- 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  
"),Trainer[i];

      Alan







reply via email to

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