set i /1*2/;
parameter report;
loop(I,
report = i.val;
display report;
);
Cheers
Renger
From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of visvalley9@gmail.com
Sent: Tuesday, October 8, 2013 4:15 PM
To: gamsworld@googlegroups.com
Subject: Re: Need help with simple Gams problem
Thanks for your response. It has been helpful. I have one question though. Instead of displaying the value of distest in your example, is there any way to display the values of set j in the order its been processed in the loop i.e I want it to display
5
6
4
and also assign their values to something that is input to another model.
When I write display j, its displaying the values of set j in the order 4 5 6. Actually in my program, these values represent clients. So, after sorting, I want to use those to solve another model. The cost associated with them are not useful in the program I want to write further. It was only useful to sort the clients.
Thanks in advance.
On Sunday, October 6, 2013 4:00:18 PM UTC+2, visva...@gmail.com wrote:
Hi. I have been trying to solve this problem for some days now and I am new to GAMS.
I have declared sets;-
set i / 1*6 /;
set tm(i) / 4*6 /;
For each value of set tm, I am solving a model to find the optimal cost. The result I get is stored in a parameter cost(i). So the result stored in cost are :
4 -100.00, 5 -500.00, 6 -200.00
Now, I want to first use the value of set tm that has the least cost, and so on in my GAMS code. So, I would like to use 5 first, then 6 and then 4 from set tm.
Can someone please help me with this. Thanks in advance.
–
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/groups/opt_out.
–
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/groups/opt_out.