Skip to main content

What does the index property in setObjectiveN do when it is set to 0?

Answered

Comments

1 comment

  • Marika Karbstein
    Gurobi Staff Gurobi Staff

    Hi Tomas,

    You can add an objective via the setObjective method. This is then the primary objective. You can add multiple objectives using the setObjectiveN method. If an objective was already set with the setObjective method then setObjectiveN with 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,
    Marika

    0

Please sign in to leave a comment.