Try our new documentation site (beta).
Model.setParam()
setParam ( paramname, newvalue )
Set the value of a parameter to a new value. Note that this method only affects the parameter setting for this model. Use global function setParam to change the parameter for all models.
You can also set parameters using the Model.Params
class. For
example, to set parameter MIPGap
to value 0 for model
m
, you can do either m.setParam('MIPGap', 0)
or
m.Params.MIPGap=0
.
Please consult the parameter section for a complete list of Gurobi parameters, including descriptions of their purposes and their minimum, maximum, and default values.
Arguments:
paramname: String containing the name of parameter that you would like to modify. The name can include '*' and '?' wildcards. If more than one parameter matches, the matching names are listed and none are modified. Note that case is ignored.
newvalue: Desired new value for parameter. Can be 'default', which indicates that the parameter should be reset to its default value.
Example usage:
model.setParam("heu*", 0.5) model.setParam(GRB.Param.heuristics, 0.5) model.setParam("heu*", "default")