[AMPL 16145] Equal Resource Allocation Constraint through for loop in AMPL or How?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 16145] Equal Resource Allocation Constraint through for loop in AMPL or How?

khan
Greetings,

I have following model:

minimize INT: sum{e in 1..u,i in 1..n} I[e,i]*Pall[e,i];

subject to PMAY: sum{e in 1..u,i in 1..n} Pall[e,i] <= Pmay

I want to allocate equal values to my decision variable Pall for all e and i. At the same time I want to fulfil the PMAY constraint as well.  
Do I need to adopt a for loop here? Or How can I define it?

Please suggest.


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 16157] Equal Resource Allocation Constraint through for loop in AMPL or How?

AMPL mailing list
You could define one variable Pall instead of all the variables Pall[e,i] if you want all of the variables to be equal.

Thanks,
Paras

--
Paras Tiwari
[hidden email]
{#HS:559228157-4964#}
On Wed, Apr 11, 2018 at 4:40 PM UTC, Zeyad Kassem' Via Ampl Modeling Language <[hidden email]> wrote:
Greetings,

I have following model:

minimize INT: sum{e in 1..u,i in 1..n} I[e,i]*Pall[e,i];

subject to PMAY: sum{e in 1..u,i in 1..n} Pall[e,i] <= Pmay

I want to allocate equal values to my decision variable Pall for all e and i. At the same time I want to fulfil the PMAY constraint as well.
Do I need to adopt a for loop here? Or How can I define it?

Please suggest.


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.