Thanks Arne,
I am aware of the exponential number of cases but, since both n and m are small (3-5), this is not that many problems (instead of solving an intractable MINLP, I will solve n**m linear problems).
My main problem is exactly what you said: to do this independently of the size of the set ln. Still trying
Regards
Fede
On Wed, Jan 21, 2015 at 3:08 PM, Arne Stolbjerg Drud wrote:
Hi Fede
The first thing you need is some way to enter your predefined values. This can be done with something like
Set cases / c1*c4 /;
Parameter hvalues(cases) / c1 1, c2 5, c3 10, c4 20 /;
The next is to generate a loop over the possible combinations. I am not sure whether you can do it general independent on the size of the set ln.
But do you realize that you will have card(ln)card(cases) = nm = 5**4 = 1024 combinations? That is a lot!
Arne
\
Arne Stolbjerg Drud
ARKI Consulting & Development A/S
Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark
Phone: (+45) 44 49 03 23, email: adrud@arki.dk
From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Federico Perea
Sent: Wednesday, January 21, 2015 2:40 PM
To: gamsworld@googlegroups.com
Subject: programming flow set parameter
Dear Gams users,
I have a model with several sets of parameters. One of them, set ln /1*5/, has an associated parameter h(ln), which can take only a small number of values (predefined), say h(ln) in {1,5,10,20}.
I would like to solve my model for each possible combination of values for parameter h. Something like this:
For each possible combination of (h(1),…,h(5))
solve model(h(1),…,h(5))
end for.
Despite many tries, I haven’t succeeded Any ideas about how to program this?
Thanks in advance
Fede
PS: I gave the number of elements in the set and the number of possible values of the parameter as indications. Of course in general there are n elements in the set, and m possible values for the parameter.
–
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.