Option file Input from GDX Topic is solved

Problems with syntax of GAMS
Post Reply
Janisch
User
User
Posts: 38
Joined: 3 years ago

Option file Input from GDX

Post by Janisch »

Hello all,
how can I adjust the option optcr in the option file so that I can use a value (scalar) from the gdx file for this?

Code: Select all

SCALAR  rel_opt_tolerance         Relative Optimality criterion;
$Onecho > cplex.opt
threads=1
tilim=120
optcr=rel_opt_tolerance
datacheck 2  
mipdisplay 4
$Offecho
I have attached a picture of the error.
error.JPG
Thanks for your help
Janisch
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: Option file Input from GDX

Post by abhosekar »

You have to convert rel_opt_tolerance to a compile time variable using $eval as follows

Code: Select all

$eval critopt crit_opt
Then you can use %critopt% in the options file.

Code: Select all

$Onecho > cplex.opt
optcr= %critopt%
$Offecho

Hope this helps.

- Atharv
Janisch
User
User
Posts: 38
Joined: 3 years ago

Re: Option file Input from GDX

Post by Janisch »

Thank you Atharv!
Post Reply