Model.remove()


Model.remove()

remove ( item )

Remove a variable, linear constraint, quadratic constraint, general constraint, or SOS from a model.

Arguments:

item: The item to remove from the model. The item can be a Var, a Constr, QConstr, SOS, or a GenConstr.

Example usage:

  model.remove(model.getVars()[0])
  model.remove(model.getConstrs()[0])
  model.remove(model.getQConstrs()[0])
  model.remove(model.getSOSs()[0])
  model.remove(model.getGenConstrs()[0])