Page 1 of 1

Error: Real number expected

Posted: Thu Jan 31, 2019 5:21 pm
by PeterBe
Hi all,

I have a problem that I do not understand why it occurs. I specify the following options

Code: Select all

Option optcr =  option_relativeGap;
Option optca = option_absoluteGap;
Option Reslim = option_timeLimit;
and I get an error: Ral number expected

I read the parameters (option_relativeGap, option_absoluteGap, option_timeLimit) from a GDX file where they are displayed in a correct way.

Code: Select all

$LOAD option_relativeGap

$LOAD option_absoluteGap

$LOAD option_timeLimit
The values are real numbers. Does anyone have a clue what the problem is? I would be quite thanful.

Re: Error: Real number expected

Posted: Wed Feb 06, 2019 2:54 pm
by Renger

I assume that you use the options in your model file and not in a separate opt-file.
You should then write these options like:

mymodel.optcr = option_relativeGap;

where mymodel is the model name of the model you are trying to solve.

Hope this helps;

Re: Error: Real number expected

Posted: Sun Feb 10, 2019 10:32 am
by PeterBe
Thanks Renger for your help. This was indeed the problem.