Some questions regarding set declaration

Archive of Gamsworld Google Group
Archiver
User
User
Posts: 7876
Joined: 1 year ago

Some questions regarding set declaration

Postby Archiver » 2 years ago


I want to assign a set of generators to different buses. I know it can be done as follows,

set i buses /1*10/ ;
set g generators /g1*g3/ ;
set map(g,i) mapping generators to bus /g1.1, g2.4, g3.6/ ;

But I want to achieve the same via gdx utility either using a separate excel or csv data set. I have one column of the generator and another column indicating its bus no.How could it be done so that I don't need to manually perform the assignment within the model?

I want to define a set of lines also connecting two buses of the set 'bus'. I have the information of originating and ending bus of the lines in my excel/csv data set. How can I define the set of the lines both within the model and via gdx data transfer?

Any help will be appreciated.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Archiver
User
User
Posts: 7876
Joined: 1 year ago

RE: Some questions regarding set declaration

Postby Archiver » 2 years ago


Hi Partha



Here is how I would do using the mapping in my excel file (two columns with the sets and making it a parameter in the excel file by assigning a value of 1 to it.



set bus /1*10/,

gen /g1*g3/;



parameter mapping(gen, bus) Values for mapping from Generator to bus;



* Read the parameter from your excel sheet or csv file

* (here I add them manually)

mapping("g1","1") = 1;

mapping("g2","4") = 1;

mapping("g3","6") = 1;



set mapGenBus(gen,bus) Mapping from Generator to Bus;



mapGenBus(gen, bus)$mapping(gen, bus) = YES;



display mapGenBus;



set mapGenBus2(gen, bus) Explicit Mapping from Generator to Bus;

/g1.1, g2.4, g3.6/;



* Check if we have the same mappings

display mapGenBus, mapGenBus2;



The same procedure could be used for your bus lines.



Hope this helps



Renger





From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Partha Das
Sent: Mittwoch, 23. September 2015 21:53
To: gamsworld
Subject: Some questions regarding set declaration



I want to assign a set of generators to different buses. I know it can be done as follows,



set i buses /1*10/ ;

set g generators /g1*g3/ ;

set map(g,i) mapping generators to bus /g1.1, g2.4, g3.6/ ;



But I want to achieve the same via gdx utility either using a separate excel or csv data set. I have one column of the generator and another column indicating its bus no.How could it be done so that I don't need to manually perform the assignment within the model?



I want to define a set of lines also connecting two buses of the set 'bus'. I have the information of originating and ending bus of the lines in my excel/csv data set. How can I define the set of the lines both within the model and via gdx data transfer?



Any help will be appreciated.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

ggutiera
User
User
Posts: 1
Joined: 7 months ago

Re: Some questions regarding set declaration

Postby ggutiera » 7 months ago

I want to assign a set of generators to different buses. I know it can be done as follows,

set i buses /1*10/ ;
set g generators /g1*g3/ ;
set map(g,i) mapping generators to bus /g1.1, g2.4, g3.6/ ;

But I want to achieve the same via wgdx utility from Matlab. I have one column of the generator and another column indicating its bus no.How could it be done so that I don't need to manually perform the assignment within the model?

Thanks is advance.


Who is online

Users browsing this forum: No registered users and 2 guests