help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Fwd: Please kindly help to reiew the multi-skill model


From: Xypron
Subject: Re: [Help-glpk] Fwd: Please kindly help to reiew the multi-skill model
Date: Mon, 08 Mar 2010 19:02:17 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100205 SeaMonkey/2.0.3

Hello Malinee,

it would be helpful, if you could supply an example that creates the error.

From what I have understood you want to write something like:

set P1;
set P2;
set P3;
set P4;
var x2{p1 in P1, p2 in P2, P3, P4 : p1 <> p2} >= 0;
minimize obj :
  sum{p1 in P1, p2 in P2, p3 in P3, p4 in P4 : p1 <>p2}x2[p1,p2,p3,p4];
solve;
# output excluding p1 == p2
for {p1 in P1, p2 in P2, p3 in P3, p4 in P4 : p1 <> p2} {
  printf "x2[%d,%d,%d,%d]=%f\n",
     p1, p2, p3, p4, x2[p1,p2,p3,p4];
}
data;
set P1 := 1,2,3;
set P2 := 1,2;
set P3 := 4,5;
set P4 := 6,7;
end;

Best regards

Xypron


Malinee Wongruean wrote:
Please kindly help to correct the "post solving error" that occur after the program solve the 
model. The detail outcome was not came out ( I do the For loop in order to print it out). But for the 
objective value is came out just fine. I have 2 variables that I want to print it out so I use 2 lines of 
"printf" in the same For loop. Also there is out of domain error for one variable value for 
example I set the constrains for the variable: X2 p1,p2,p3,p4  where p1<>p2 but why the result 
still show the domain that p1 = p2 and that is the reason why the error has occurred.





reply via email to

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