Try our new documentation site.


Model()

Model ( name="", env=defaultEnv )

Model constructor.

Arguments:

name: Name of new model.

env: Environment in which to create the model. Creating your environment (using the Env constructor) gives you more control over Gurobi licensing, but it can make your program more complex. Use the default environment unless you know that you need to control your own environments.

Return value:

New model object. Model initially contains no variables or constraints.

Example usage:

  m = Model("NewModel")
  x0 = m.addVar()

  env = Env("my.log")
  m2 = Model("NewModel2", env)

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