help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Gnu Mathprog: Projection operator?


From: Andrew Makhorin
Subject: Re: [Help-glpk] Gnu Mathprog: Projection operator?
Date: Sun, 10 Jan 2010 20:07:38 +0300

> In my optimization model, I read data from several .csv-files. This
> looks as follows:
>  
> table loaddata IN "CSV" "Exp.csv":L<-[LType, App,Time]
> table costdata IN "CSV" "disc_data.csv":C<-[Provider,Function, Type]
> table ressourcedata IN "CSV" "ress_data.csv":R<-[Provider, Server, Size]
>  
> now I would like to define my variables x{}; they need to feature
> the indices Provider,Server,Time and App. As I have seen in the
> example files, the variable gets to be defined using the control sets
> from the table statement. Unfortunately, I have no control set that
> directly matches my variable indices.

The csv table driver provides a fake field named RECNO containing
the record number. Probably you can use it to build the control set:

set S;
param raw_data{S};
table list IN "CSV" "list.csv": S <- [RECNO], raw_data ~ FIELD, ... ;

>  
> My first thought was to assemble the variable indices using a
> projection on my existing control sets   L,C and R, but I cannot find
> such an operator in GNU Mathprog. Another option would be to create a
> .csv-file containing the necessary indices, but that seems a bit
> complicated.
>  
> 1. Is there any way a projection can be realized in Mathprog?

setof{}

> 2. What is the best way to define the index set for my variable
> definition? (e.g. creating another .csv-file?)






reply via email to

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