Search found 6 matches
- 1 year ago
- Forum: Syntax
- Topic: Elements and set assignments
- Replies: 8
- Views: 4869
Re: Elements and set assignments
Hi! I took your advise and redid the whole set hierarchy appropriate to the model structure, and as predicted, it worked smoothly with only declaring the parameters over the subset, without the loop. "evfb_la(aez, acts, reg) = evfb_1(aez, acts, reg);" The lesson is clear, be careful when m...
- 1 year ago
- Forum: Syntax
- Topic: Elements and set assignments
- Replies: 8
- Views: 4869
Re: Elements and set assignments
Hi! I took your advise and redid the whole set hierarchy appropriate to the model structure, and as predicted, it worked smoothly with only declaring the parameters over the subset, without the loop. "evfb_la(aez, acts, reg) = evfb_1(aez, acts, reg);" The lesson is clear, be careful when m...
- 1 year ago
- Forum: Syntax
- Topic: Elements and set assignments
- Replies: 8
- Views: 4869
UPDATE
I managed to solve it like this: loop((endw,aez)$(sameas(endw,aez)), evfb_la(aez, acts, reg) = evfb_1(endw, acts, reg) ; ) ; Still, I am left wondering why in some cases it would appear to work fine, meaning that it copies over all sets, with the exception of one region (one element of set reg).
- 1 year ago
- Forum: Syntax
- Topic: Elements and set assignments
- Replies: 8
- Views: 4869
Re: Elements and set assignments
*** after declaring the variables, the line for uploading the var evfb_1 should read
Code: Select all
execute_loaddc 'DAT.GDX',
evfb_1
;
- 1 year ago
- Forum: Syntax
- Topic: Elements and set assignments
- Replies: 8
- Views: 4869
Re: Elements and set assignments
dat.gdx Thank you Michael. Unfortunately the way you proposed shows Error 171. I will attach a small code and the data set. If you run it like this, it will produce the variable evfb_la(aez,acts,reg) as I want it, by using the method of writing each element of aez(endw) in the loop. Below are the a...
- 1 year ago
- Forum: Syntax
- Topic: Elements and set assignments
- Replies: 8
- Views: 4869
Elements and set assignments
Hello, I am new at GAMS, so this might seems trivial, but I havenĀ“t been able to solve this problem. I have the following code to retrieve data from a .gdx file. *1st Parameters evfb_1(endw, acts, reg) !!this is the variable that contains the data evfb_la(aez, acts, reg) ; loop(endw$aez(endw), evfb_...