Convert mathprog model (file.mod) to Python gurobi model

236 views
Skip to first unread message

J. Friedman

unread,
Nov 1, 2016, 2:44:19 PM11/1/16
to Gurobi Optimization
Is there an easy way to convert my model, written in the mathprog language to a gurobi Python script. Right now, I convert the mathprog mod to an LP file, and then solve, but it is awkward to get the solution variables. Is there any conversion tool or script out there?

Sonja Mars

unread,
Nov 3, 2016, 5:00:31 AM11/3/16
to gur...@googlegroups.com
Hi,

We are not aware of a conversion tool or script to do this. Sorry. Maybe someone from the community knows more.

I guess you will have to do it by hand. However, our Python API is very intuitive and easy to use. Additionally, we recently added a lot of nice methods that make modeling much easier. As a starting point you might want to take a look at our examples. Here you can find a nice introduction:
http://www.gurobi.com/documentation/7.0/quickstart_linux/py_python_interface.html

Best regards,
Sonja


----
Dr. Sonja Mars
Gurobi Optimization - Technical Support





Greg Glockner

unread,
Nov 4, 2016, 1:43:55 PM11/4/16
to Gurobi Optimization
mathprog is similar to AMPL. You can either purchase AMPL and use AMPL with Gurobi, or you will need to rewrite your script.
Reply all
Reply to author
Forward
0 new messages