[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] problem with parameter
From: |
Robbie Morrison |
Subject: |
Re: [Help-glpk] problem with parameter |
Date: |
Wed, 18 Jul 2012 02:15:53 +1200 |
User-agent: |
SquirrelMail/1.4.22 |
Hello Daniele
------------------------------------------------------------
To: Daniele Micarelli <address@hidden>,
address@hidden
Subject: Re: [Help-glpk] problem with parameter
Message-ID: <address@hidden>
From: "glpk xypron" <address@hidden>
Date: Mon, 16 Jul 2012 22:54:09 +0200
------------------------------------------------------------
Just to add to what Xypron suggested. If your original
data is table-oriented (also known as a flat file
database), then you will need to pre-process that to get
it into the required data format:
http://en.wikipedia.org/wiki/Flat_file_database
There are many ways of doing this, depending on your
circumstances. Any scripting language will do:
http://en.wikipedia.org/wiki/Python_%28programming_language%29
Also, any problem-oriented environment:
http://en.wikipedia.org/wiki/Matlab
http://en.wikipedia.org/wiki/Octave
Or programming text editor:
http://en.wikipedia.org/wiki/GNU_Emacs
Text files of hundreds of thousands of lines are not a
problem for modern operating systems -- although text
strings are very inefficient for storing numbers.
That said, hard drives are cheap nowadays.
You do realize too that you can read spreadsheet
data directly into GLPK using GMPL/MathProg:
http://en.wikibooks.org/wiki/GLPK/ODBC
HTH, Robbie
---
> Hello Daniele,
>
> where is your problem in writing the data file?
> A data file can have as many lines as you want.
>
> set I:= {0..100};
> set T:= {0..600};
> param w{I,T};
>
> data;
> param w :=
> [ 0, 0] 0.128312
> [ 0, 1] 0.009597
> ...
> [ 0,600] 0.029687
> [ 1, 0] 0.553792
> ...
> [ 1,600] 0.818264
> ...
> [100,600] 0.029687
> ...
> [100,600] 0.412226
> end;
>
> Just replace ... by the missing lines.
>
> Best regards
>
> Xypron
---
Robbie Morrison
PhD student -- policy-oriented energy system simulation
Technical University of Berlin (TU-Berlin), Germany
University email (redirected) : address@hidden
Webmail (preferred) : address@hidden
[from Webmail client]