At 12:59am -0400 Sat, 30 Jun 2012, Glpk Xypron wrote:
try the following:

set EFF, dimen 5;
set inputs := setof{(i,p,v,o,e) in EFF}i;
set process := setof{(i,p,v,o,e) in EFF}p;
set vintage := setof{(i,p,v,o,e) in EFF}v;
set outputs := setof{(i,p,v,o,e) in EFF}o;
set S := setof{(i,p,v,o,e) in EFF} (i,p,v,o);
param eff{(i,p,v,o) in S} := sum{(i,p,v,o,e) in EFF}e;
solve;
display eff;
data;
set EFF :=
# input     process        vintage output      efficieny
   coal      coal_pp        2015    electricity 0.4
   uranium   nuclear_pp     2015    electricity 0.4
   sunlight  passive_solar  2020    heat        0.6;
end;

Most excellent! I was not aware that I could use sets in this manner. That is exactly the functionality for which I was searching. Thank you.

I was similarly not aware of how to use setof, and with this piece, I was able to clean up a bunch of other sections to my model as well.

Thank you again,

Kevin

_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to