update reslim

Dear GAMS users,

I am writing a code in GAMS, and I need the reslim (computation time allowed) to be updated after each iteration. Something like that:

t=0;
WHILE( bla bla;
option reslim = 3600-t;
solve model;
t=cpu time to solve model;
update model;
);

I tried this but I got nothing but errors. Any idea about how to make the reslim to decrease after each iteration?

Thanks in advance!

Fede


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 Frederico



No idea, why you want to implement this, but the following works for me:



Parameter t /0/;

Loop(…

mymodel.reslim = 3600-t;

SOLVE mymodel MAXIMIZING U USING NLP;

t=apem.resusd;

display t;

);



With a while loop it will not be different.

Cheers

Renger




\


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch





From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Federico Perea
Sent: Tuesday, November 11, 2014 15:23
To: gamsworld@googlegroups.com
Subject: update reslim



Dear GAMS users,



I am writing a code in GAMS, and I need the reslim (computation time allowed) to be updated after each iteration. Something like that:



t=0;

WHILE( bla bla;

option reslim = 3600-t;

solve model;

t=cpu time to solve model;

update model;

);



I tried this but I got nothing but errors. Any idea about how to make the reslim to decrease after each iteration?



Thanks in advance!



Fede


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.

Thanks Renger, it works! (instead of t=apem.resusd; I wrote t=mymodel.resusd;)

Answering your question, I want this for an algorithm in which in each iteration I solve the same model after having added some new constraints.

Thanks again!

Fede

On Wed, Nov 12, 2014 at 11:50 AM, Renger van Nieuwkoop wrote:

Hi Frederico



No idea, why you want to implement this, but the following works for me:



Parameter t /0/;

Loop(…

mymodel.reslim = 3600-t;

SOLVE mymodel MAXIMIZING U USING NLP;

t=apem.resusd;

display t;

);



With a while loop it will not be different.

Cheers

Renger




\


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch





From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Federico Perea
Sent: Tuesday, November 11, 2014 15:23
To: gamsworld@googlegroups.com
Subject: update reslim



Dear GAMS users,



I am writing a code in GAMS, and I need the reslim (computation time allowed) to be updated after each iteration. Something like that:



t=0;

WHILE( bla bla;

option reslim = 3600-t;

solve model;

t=cpu time to solve model;

update model;

);



I tried this but I got nothing but errors. Any idea about how to make the reslim to decrease after each iteration?



Thanks in advance!



Fede


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.