help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] [Fwd: MathProg model processing error: field CPT missing in


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: MathProg model processing error: field CPT missing in input table]
Date: Tue, 28 Aug 2012 11:20:26 +0400

-------- Forwarded Message --------
From: Robert Schroeder <address@hidden>
To: address@hidden
Subject: MathProg model processing error: field CPT missing in input
table
Date: Tue, 28 Aug 2012 02:06:59 -0500

Hi,
I'm having trouble reading data from an input table.  Funny thing is I
get the same basic error no matter if I use a CSV file or an Access
table (via ODBC).  I'm very new to GLPK and the modelling language, so
perhaps I'm missing a key point, but I'm able to fill other Sets and
Parameters using the same approach.
 
Here's my model (InputError.mod):
 
set MC dimen 2;
set CITY;
set MFG;
param Mcost {CITY, MFG};
table mcost IN "CSV" "tblMFGFreight1.csv":
MC <- [ CITY, MFG ], Mcost ~ CST;
display Mcost;
#table mcost IN "ODBC"
#  'DRIVER={Microsoft Access Driver (*.mdb)};dbq=glpk.mdb'
#  'tblMFGFreight' :
#   MC <- [ CITY , MFG ], Mcost ~ CPT;
end;

Here's the resultI get trying to read from a CSV file:
>C:\Software\gusek\glpsol.exe --cover --clique --gomory --mir -m
"InputError.mod"    
GLPSOL: GLPK LP/MIP Solver, v4.47
Parameter(s) specified in the command line:
 --cover --clique --gomory --mir -m InputError.mod
Reading model section from InputError.mod...
14 lines were read
Reading mcost...
InputError.mod:6: field CST missing in input table
MathProg model processing error
>Exit code: 1    Time: 0.222
 
And here's what I get when I try to read from an  Access database:
>C:\Software\gusek\glpsol.exe --cover --clique --gomory --mir -m
"InputError.mod"    
GLPSOL: GLPK LP/MIP Solver, v4.47
Parameter(s) specified in the command line:
 --cover --clique --gomory --mir -m InputError.mod
Reading model section from InputError.mod...
15 lines were read
Reading mcost...
Connected to ACCESS 04.00.0000 - .\glpk
SELECT CITY, MFG, CPT FROM tblMFGFreight
InputError.mod:10: field CPT missing in input table
MathProg model processing error
>Exit code: 1    Time: 0.225
 
So I get the same error.  Like I said, all my other inputs are working
fine, it just craps out on this data table.  It can't seem to find the
CPT field.  Not sure if it will make it, but I've attached the csv file
I'm trying to read.
 
I'm running on Windows 7, 32 bit.
 
Thanks,
Rob

 

Attachment: tblMFGFreight1.csv
Description: Text Data


reply via email to

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