What does the index property in setObjectiveN do when it is set to 0?
AnsweredsetObjectiveN has a property called "index". The documentation mentions that, for index=0, "this routine will change the primary optimization objective.". What does that mean? Which "routine" does the documentation refer to? Moreover, what does "will change the primary optimization objective" mean? Isn't the primary optimization objective determined by the "priority" property?
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Tomas,
You can add an objective via the
setObjectivemethod. This is then the primary objective. You can add multiple objectives using thesetObjectiveNmethod. If an objective was already set with thesetObjectivemethod thensetObjectiveNwith index=0 will change this primary objective. See also Specifying Multiple Objectives (gurobi.com)
Also when you change the number of multiple objectives with the parameter NumObj, the objectives are kept according to their indices. For example, if you set NumObj=1, the objective with index=0 is kept.Best regards,
Marika0
Post is closed for comments.
Comments
2 comments