Documentation


Model()

Model ( name="", env=defaultEnv )

Model constructor.

Arguments:

name: Name of new model. Note that name will be stored as an ASCII string. Thus, a name like 'A${\rightarrow}$B' will produce an error, because '${\rightarrow}$' can not be represented as an ASCII character. Note also that names that contain spaces are strongly discouraged, because they can't be written to LP format files.

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)