parameter assignment with Iteration

hello,

i am a new GAMS und i need some help.

i want to define a parameter s und assign it as t=t/iter, s should change in each iteration, how can i code it. Can anyone help and 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/d/optout.

hi:

set iter /1*10/
parameters t,s(iter);

s(iter)=t/ord(iter);

hope to help
regards

On Wed, Jun 24, 2015 at 5:40 AM, Yu Li wrote:

hello,

i am a new GAMS und i need some help.

i want to define a parameter s und assign it as t=t/iter, s should change in each iteration, how can i code it. Can anyone help and 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/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.

hi claudio,

there is a another question, can you help me again?
I want to show my variable qfest.l like this way q(i,l), how should i code it, see the code below. Thank you in advance.


sets

i Lieferanten /L1L3/
l Rabattstufen /R1
R3/ ;


Table P(i,l) Preis

R1 R2 R3
L1 50
L2 48
L3 49 ;

Table QU(i,l) Untergrenzen von Rabattstufe

R1 R2 R3
L1 30
L2 40
L3 30 ;

Table QO(i,l) Obergrenzen von Rabattstufe

R1 R2 R3
L1 60
L2 80
L3 70 ;



Parameters

QM(i) maximale Lieferraten

/L1 28
L2 20
L3 15/

K(i) fixe Lieferkosten

/L1 110
L2 120
L3 115/

Preis
QUfest
QOfest
Kfest
QMfest;



Scalars d Bedarf pro Periode /35/
lz Lagerzinssatz /0.03/ ;

Variables

qfest Bestellmenge
C Gesamtkosten
q(i,l);


integer Variable qfest ;

Equations

Kosten Gesamtkosten
NB1 Untergrenze von Bestellmenge
NB2 Obergrenze von Bestellmenge ;


Kosten… C =e= Preisd + lz/2Preisqfest + Kfestd/qfest;
NB1… qfest =g= QUfest ;
NB2… qfest =l= QOfest ;

Model Bestellmenge /all/ ;

qfest.lo=1;


loop((i,l)$(ord(i)=ord(l)),
Preis=P(i,l);
QUfest=QU(i,l);
QOfest=QO(i,l);
Kfest=K(i);
solve Bestellmenge using minlp minimizing C;
display qfest.l
q(i,l).l=qfest.l;
);
在 2015年6月24日,18:37,Claudio Delpino 写道:

hi:

set iter /1*10/
parameters t,s(iter);

s(iter)=t/ord(iter);

hope to help
regards

On Wed, Jun 24, 2015 at 5:40 AM, Yu Li wrote:

hello,

i am a new GAMS und i need some help.

i want to define a parameter s und assign it as t=t/iter, s should change in each iteration, how can i code it. Can anyone help and 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/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.


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.