Working with multiple models

The Gurobi shell allows you to work with multiple models simultaneously. For example...

gurobi> a = read('c:/gurobi560/win64/examples/data/p0033')
Read MPS format model from file c:/gurobi560/win64/examples/data/p0033.mps
Reading time = 0.00 seconds
P0033: 16 Rows, 33 Columns, 98 NonZeros.
gurobi> b = read('c:/gurobi560/win64/examples/data/stein9')
Read MPS format model from file c:/gurobi560/win64/examples/data/stein9.mps
Reading time = 0.00 seconds
STEIN9: 13 Rows, 9 Columns, 45 NonZeros.
The models() command gives a list of all active models.
gurobi> models()
Currently loaded models:
a : <gurobi.Model MIP instance P0033: 16 constrs, 33 vars>
b : <gurobi.Model MIP instance STEIN9: 13 constrs, 9 vars>

Note that parameters can be set for a particular model with the Model.setParam() method or the Model.Params class, or they can be changed for all models in the Gurobi shell by using the global setParam() method.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search