help-glpk
[Top][All Lists]
Advanced

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

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


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

> 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

You attempt to read the parameter Mcost from the field CST, however, the
csv file you provided has the field named CPT, not CST.






reply via email to

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