Page 1 of 1

problem in Printing Optcr

Posted: Wed Mar 13, 2019 4:04 pm
by sachinpatel_03
Hello,

I'm solving a scenario problem and I need to store the value of optcr associated with every scenario solution in the excel file.

I tried using

PUT 'OG',loop (scn, PUT optcr)PUT/;

but it gave an error 140

Error 140 in......
Unknowm sysmbol



Please help.

Re: problem in Printing Optcr

Posted: Thu Mar 14, 2019 6:05 am
by bussieck
You can access run time options only through the option statement for setting: "option optCR=0.05;". If you want to do more with optCR e.g. write it out at its current value you should switch to the model attribute (see https://www.gams.com/latest/docs/UG_Mod ... Attributes) modelname.optCR. This one overwrites the global run-time option optCR and is accessible in other statements like put:

Code: Select all

* Instead of option optCR=0.05 do
modelmodel.optCR = 0.05;
solve mymodel min obj using mip;
put mymodel.optCR /;
-Michael

Re: problem in Printing Optcr

Posted: Thu Mar 14, 2019 1:18 pm
by sachinpatel_03
Hello Michael,

Thank you it solved the issue.

I can do a lot more now with this approach. I didn't know about it.

Thank you.