GAMS-dev / gams.jl

A MathOptInterface Optimizer to solve JuMP models using GAMS
MIT License
34 stars 3 forks source link

JuMP.direct_model does not work with GAMS.Optimizer() #14

Closed MartinBonde closed 2 years ago

MartinBonde commented 2 years ago

Using direct_model with GAMS.Optimizer as shown in the README throws an error:

using JuMP
using GAMS
model = direct_model(GAMS.Optimizer())
Error showing value of type Model:
ERROR: ArgumentError: GAMS.Optimizer does not support getting the attribute MathOptInterface.Name().

I am running the latest versions of both JuMP and GAMS: GAMS v0.3.2 JuMP v0.22.3

blegat commented 2 years ago

This is because it's trying to print the model, try ending the line with a semicolon:

using JuMP
using GAMS
model = direct_model(GAMS.Optimizer());
MartinBonde commented 2 years ago

Thanks! That works.

renkekuhlmann commented 2 years ago

I added the Name attribute along with ListOfConstraintTypesPresent. This will be available with v0.3.3 and fixes this issue. Thanks for reporting!