help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Generate data section files for model (in GNU MathProg o


From: Tony Khosravi
Subject: Re: [Help-glpk] Generate data section files for model (in GNU MathProg or other languages)
Date: Wed, 9 May 2012 23:03:28 +0200

Hi,

Thanks for your answer!

For the use of the "printf" command, the fact is that I find it not very flexible. Indeed, I have to write in plain text what I want to write as param. The syntax is different when the param is a simple list of records or when it is tabbing data.

When you mention the use of a database and the table statement, isn't it when you have one model and you want to run the solver on one set of data? I am interesting in running the solver many times (with my c++ program) through many records of data with only on model.

The use of table statement here is limited because the table statement cannot be used in the data section (not as far as I know). Or in that case, I would have to generate as many models as the number of data that I want to use by only changing the part related to table statement.As I want to keep in very simple (that is being able to use the program on different computer without having to copy whole bunch of data structure like a database), maybe the use of a CSV file would be better. In that case, if I keep following this table-statement solution, I would have many .mod file with one last line which initializes data. The table statement would be different for each file in the sense that each .mod file will be linked to different .csv files (like table data1 in "CSV" "data1.csv" ... , table data2 in "CSV" "data2.csv" ... ). However, I found this option still not as flexible as I want (maybe either I don't get want you mean, I work with glpk for only a month and with the basic functions, or I am too exigent).

Regards,

2012/5/9 glpk xypron <address@hidden>
Hello Tony,

GMPL data files can be easily created with any tool that can output text files, cf.
http://en.wikibooks.org/wiki/GLPK/Scripting_plus_MathProg

You could use the printf command of GMPL to create data files.

When many data shall be used with the same model, I personally would use a SQL data base, which can be read with the table statement.

Best regards

Xypron
-------- Original-Nachricht --------
> Datum: Wed, 9 May 2012 17:13:36 +0200
> Betreff: [Help-glpk] Generate data section files for model (in GNU MathProg   or other languages)

> Hi,
>
> I would like to know if it was possible to generate any data files in the
> GNU MathProg format with the GLPK lib.
>
> When I am talking about data file, I mean the data section of model data.
> The aim would be to be able to generate many text files containing only
> the
> data section so that they can be used later with the solver and a file
> containing only the model section. I didn't find any thing like that.
>
> My thought is now to try to implement a general lib to generate sets or
> parameters in a text file according to the documentation gmpl, but I was
> wondering it this had been done before (which might be probable).
>
> I also had the idea of using the table statement with the CSV driver, but
> apparently, it cannot be used in the data section, only in the model
> section, and I don't want to touch the file with the model. The aim is to
> keep the data section separate from the model section.
>
> --
> *Tony Khosravi Dehkourdi*
>
> MSc. Student - Computer Systems
> *Linköping University*
> Elève ingénieur -- Génie Informatique, Systèmes et Réseaux
> d'Informations
> (GI06)*
> Université de Technologie de Compiègne*
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



--
Tony Khosravi Dehkourdi

MSc. Student - Computer Systems
Linköping University
Elève ingénieur -- Génie Informatique, Systèmes et Réseaux d'Informations (GI06)
Université de Technologie de Compiègne

Tel:+46 7 60 69 51 57

reply via email to

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