problem in Printing Optcr Topic is solved

Problems with modeling
Post Reply
sachinpatel_03
User
User
Posts: 7
Joined: 5 years ago

problem in Printing Optcr

Post 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.
User avatar
bussieck
Moderator
Moderator
Posts: 1037
Joined: 7 years ago

Re: problem in Printing Optcr

Post 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
sachinpatel_03
User
User
Posts: 7
Joined: 5 years ago

Re: problem in Printing Optcr

Post 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.
Post Reply