The Gurobi interactive shell allows you to perform hands-on interaction and experimentation with optimization models. You can read models from files, perform complete or partial optimization runs on them, change parameters, modify the models, reoptimize, and so on. The Gurobi shell is actually a set of extensions to the Python shell. Python is a rich and flexible programming language, and any capabilities that are available from Python are also available from the Gurobi shell. We'll touch on these capabilities here, but we encourage you to explore the help system and experiment with the interface in order to gain a better understanding of what is possible.
One big advantage of working within Python is that the Python language is popular and well supported. One aspect of this support is the breadth of powerful Python Integrated Development Environments (IDEs) that are available, most of which can be downloaded for free from the internet. This document includes instructions for setting up Gurobi for use within the Anaconda distribution. Anaconda includes a powerful IDE (Spyder), as well as a notebook-style interface (iPython Notebook).
Before diving into the details of the Gurobi interactive shell, we should remind you that Gurobi also provides a lightweight command line interface. If you just need to do a quick test on a model stored in a file, you will probably find that that interface is better suited to simple tasks than the interactive shell.
Important note for AIX users: due to limited Python support on AIX, our AIX port does not include the Interactive Shell or the Python interface. You can use the command line, or the C, C++, or Java interfaces.
We will now work through a few simple examples of how the Gurobi shell might be used, in order to give you a quick introduction to its capabilities. More thorough documentation on this and other interfaces is available in the Gurobi Reference Manual.
- Reading and optimizing a model
- Inspecting the solution
- Simple model modification
- Simple experimentation with a more difficult model
- Changing parameters
- Parameter tuning tool
- Using a gurobi.env file
- Working with multiple models
- Interface customization
- Customization through callbacks
- The Gurobi Python Interface for Python Users