Hi Harry
There are some nice models in the GAMS model library. For example, SROUTE, TRAFFIC. I would have a close look at the techniques they use (especially the mappings) to write down a network.
Cheers
Renger
Search found 639 matches
- 5 years ago
- Forum: Modeling
- Topic: Network Flow Data
- Replies: 3
- Views: 2785
- 5 years ago
- Forum: Modeling
- Topic: Novice User seeking assistance
- Replies: 3
- Views: 4582
Re: Novice User seeking assistance
Hi I do not understand what you are trying to achieve. The code you show is obviously not doing anything as d(i,j), a parameter, should, during the solve, change according to values of Y, a variable. d(i,j) should, therefore, be a variable. Perhaps you are looking for an iterative (loop) for doing t...
- 5 years ago
- Forum: Modeling
- Topic: Very Urgent Error 172 Solutions
- Replies: 4
- Views: 3441
Re: Very Urgent Error 172 Solutions
Hi Your error comes from adding the same set elements twice (line 40 and line 42 are equal. 40 HK.SG.1.HK1.JK1.sr1, 41 HK.SG.1.JK1.SG1.sr1, 42 HK.SG.1.HK1.JK1.sr1, ... This is not the first mistake in your code. Always correct the earlier error before you proceed with the following ones, but the lat...
- 5 years ago
- Forum: Modeling
- Topic: Very Urgent Error 172 Solutions
- Replies: 4
- Views: 3441
Re: Very Urgent Error 172 Solutions
Hi If you have a very urgent error, you should at least provide the complete code that produces the error, otherwise it will be just guessing. So at least provide the code inclusive of the part that produces the error. Have a look at the "Rules" of this forum ( https://forum.gamsworld.org/...
- 5 years ago
- Forum: Modeling
- Topic: Can you help me to write the following set of constraints?
- Replies: 2
- Views: 2082
Re: Can you help me to write the following set of constraints?
Hi
You just make one constraint and multiply the number 20-part on both sides by(x(i,jm,) and the 21-part by (1 - x(i,j,m)) .
If x(i,j,m) = 1, only the 20-parts are used, if x(i,jm) = 0, only the 21-parts will be used.
CHeers
Renger
You just make one constraint and multiply the number 20-part on both sides by(x(i,jm,) and the 21-part by (1 - x(i,j,m)) .
If x(i,j,m) = 1, only the 20-parts are used, if x(i,jm) = 0, only the 21-parts will be used.
CHeers
Renger
- 5 years ago
- Forum: Syntax
- Topic: random arrays in a table
- Replies: 2
- Views: 2249
Re: random arrays in a table
Hi Here is a small example with uniformly distributed random date set i /r1*r3/, j /c1*c3/, iter /1*3/; parameter randval(i,j) Random values, randvalloop(iter, i,j) Store the random values; * Set uniform random values between 1 and 10 * and set the seed so we can reproduce the results $set seed 1234...
- 5 years ago
- Forum: Modeling
- Topic: MPSGE Soluition
- Replies: 1
- Views: 2055
Re: MPSGE Soluition
Hi You use the wrong index for investments: in your table, it is indexed by "SI", and in your model by "S-I". - You should force GAMS to check your table on errors like these by defining SAM over the set of all SAM elements. E.g.: set ac All SAM elements /a_min, apetroil, a_ael, ...
- 5 years ago
- Forum: Syntax
- Topic: put command
- Replies: 5
- Views: 4218
Re: put command
Hi I only use the f loop because you use K(i,t) in an equation with the additional index f. i and t are on both sides of the assignment but f is missing on the right: loop(f, eq_net9("K", i,f,t) = K.L(i,t); ); If K was also defined over f, you don't have to use a loop to assign values and ...
- 5 years ago
- Forum: Syntax
- Topic: Urgent HELP! , GDX output in a loop uses old variable values
- Replies: 7
- Views: 7714
Re: Urgent HELP! , GDX output in a loop uses old variable values
Hi You defined the variables over i, j and t, so if you solve the model for a smaller subset, the variables that are not part of the subset aren't changed and keep the values of the previous solve. If you add some lines where you initialize all the variable with EPS loop(... loop(... loop(.. x.L ( i...
- 5 years ago
- Forum: Syntax
- Topic: put command
- Replies: 5
- Views: 4218
Re: put command
just redefine the parameter as
and adjust the export command as follows:
This will correct the order and you will have the output according to equations.
CHeers
Renger
Code: Select all
eq_net9(i,f,t, *)
Code: Select all
execute 'gdxxrw results.gdx par=eq_net9 rng=eq_net9!a1 Rdim=3 Cdim=1
CHeers
Renger