epgap=0

Archive of Gamsworld Google Group
Post Reply
richard
User
User
Posts: 12
Joined: 4 weeks ago

epgap=0

Post by richard » 3 weeks ago

Hi

i have a three "MIP" model , i want to solve these model in one GAMS file ,i write equation for every model first, when i write


model my_model1/obj1,c1,c2/;
my_model1.Optfile =1;
file opts cplex option file/ cplex.opt /;
putclose opts /'epgap=0' /'epagap=0';
solve my_model1 using mip minimizing z;
and


model my_model2/obj2,c3,c4/;;
my_model2.Optfile =1;
file opts cplex option file/ cplex.opt /;
putclose opts /'epgap=0' /'epagap=0';
solve my_model2 using mip minimizing z1;

i have this errror "symbol redefined -a second data statement for the same symbol or data statement after an assignment ,

how can fix this problem ?

thanks

Fred
Posts: 70
Joined: 1 year ago

Re: epgap=0

Post by Fred » 3 weeks ago

Hi,

You are using the same file statement twice.

Code: Select all

file opts cplex option file/ cplex.opt /;
[...]
file opts cplex option file/ cplex.opt /;
You cannot use the same internal file name ("opts") more than once. Just get rid of the second one and you should be good.

I hope this helps!

Fred

richard
User
User
Posts: 12
Joined: 4 weeks ago

Re: epgap=0

Post by richard » 3 weeks ago

Can you explain a little more?
What exactly should I do?
I did not understand yet

Thanks

Fred
Posts: 70
Joined: 1 year ago

Re: epgap=0

Post by Fred » 3 weeks ago

Richard,

Just change your code to

Code: Select all

model my_model1/obj1,c1,c2/;
my_model1.Optfile =1;
file opts cplex option file/ cplex.opt /;
putclose opts /'epgap=0' /'epagap=0';
solve my_model1 using mip minimizing z;
[...]
model my_model2/obj2,c3,c4/;;
my_model2.Optfile =1;
putclose opts /'epgap=0' /'epagap=0';
solve my_model2 using mip minimizing z1; 
I hope this helps!

Fred

richard
User
User
Posts: 12
Joined: 4 weeks ago

Re: epgap=0

Post by richard » 3 weeks ago

I can’t thank you enough!

Post Reply