[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Table Statement with Single ValueParameters
From: |
glpk xypron |
Subject: |
Re: [Help-glpk] Table Statement with Single ValueParameters |
Date: |
Wed, 30 Jul 2008 07:57:40 +0200 |
Hello Mike,
examples for using the table statement can be found in directory examples/sql.
The idea of the table statement was to be able to read sets and parameters over
a set.
You could add a column "Index" into ./WDOInputData/WDO2InputParms.txt.
set INDEX.
param current_parameter_set = 1;
param SHIP_PENALTY[i in INDEX].
table data IN "CSV" "./WDOInputData/WDO2InputParms.txt" :
INDEX <-[Index], SHIP_PENALTY ~ ShipPenalty, ...
In the model then use
SHIP_PENALTY[current_parameter_set];
This would make it very easy to run your models with different parameter sets,
by simply changing the line
param current_parameter_set = 1;
Or you could switch columns and rows in your csv-file:
Param, Value
SHIP_PENALTY, 10
SHIP_LTL_PENALTY, 100
...
set parameters;
param values[p in parameters];
table data IN "CSV" "./WDOInputData/WDO2InputParms.txt" :
parameters <-[Param], values ~ Value;
and use in your model
Value["SHIP_PENALTY"].
Best regards
Xypron
-------- Original-Nachricht --------
> Datum: Tue, 29 Jul 2008 13:20:32 -0400
> Von: "Michael Bleau" <address@hidden>
> An: address@hidden
> Betreff: [Help-glpk] Table Statement with Single ValueParameters
> Hi,
>
>
>
> I am fairly new to GLPK so excuse me if this is too obvious. I am trying
> to
> load data into dimensionless (single value) Parameters using a table
> statement. I cannot seem to get the syntax right. For example with:
>
>
>
> table data IN "CSV" "./WDOInputData/WDO2InputParms.txt" :
>
> SHIP_PENALTY ~ ShipPenalty,
>
> SHIP_LTL_PENALTY ~ ShipLTLPenalty,
>
> SHIP_SMALL_PENALTY ~ ShipSmallPenalty,
>
> NON_GD_PENALTY ~ NonGDPenalty,
>
> DC_OFF_MID_PENALTY ~ DCOffMidPenalty,
>
> DC_CUBE_OVER_HIGH_PENALTY ~ DCCubeOverHighPenalty,
>
> DC_CUBE_UNDER_LOW_PENALTY ~ DCCubeUnderLowPenalty,
>
> DC_CUBE_OVER_PEAK_PENALTY ~ DCCubeOverpeakPenalty;
>
>
>
> I get the following message:
>
>
>
> Reading model section from WDOFormulation.mod...
>
> WDOFormulation.mod:104: SHIP_PENALTY not a set
>
> Context: ...IN_REGION_PENALTY ; table data IN '...' '...' : SHIP_PENALTY
>
>
>
> Thanks for any ideas ...
>
>
>
> Mike
>
>
>
>
>
> (GLPK 4.29, Microsoft Vista, Compiled with VisualStudio C++)
>
>
> --
> _________________________________
> Michael Bleau
> Michael Bleau & AssociƩs
> Tel: 514 247-2944
> address@hidden
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/address@hidden