help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] The use of printf.


From: Berglund Mattias
Subject: [Help-glpk] The use of printf.
Date: Fri, 22 Aug 2008 14:44:52 +0300

Hi everyone!
 
I've got stuck figuring out how to get printf work with my results.
When I use printf I get the following error:
Reading model section from city2.mod...
city2.mod:77: only numeric, symbolic, or logical _expression_ allowed
Context: ...ansfer , <= 20 ; printf { i in PLANTSC } '...' , p_c [ i ] ;
Model processing error
 
 
Where p_c is defined as:
 
var p_c{i in PLANTSC} >=0;
 
and
 
set PLANTSC := VP21 VP22 VP23...
 
but when I look in my result file without the printf statement i get

   No. Column name       Activity     Lower bound   Upper bound
------ ------------    ------------- ------------- -------------
     1 p_c[VP21]              26.667             0
     2 p_c[VP22]              26.667             0
     3 p_c[VP23]              26.667             0
     4 p_c[VP24]              26.667             0
     5 p_c[VP25]              26.667             0
     6 p_c[VP26]              26.667             0
     7 p_c[VP91]                  24             0
     8 p_c[VP92]                  24             0
 
From my point of view I should use
 
printf{i in PLANTSC} "res= %f", p_c[i]
to print the results, but get the silly error.
 
 
Best Regards
Mattias Berglund
 

reply via email to

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