Help: Switching between different objective function

Manuel Castro <[email protected]> Thu, 26 Nov 2020 18:55:55 +0000
Newsgroups gmane.comp.gnu.glpk
Message-ID <[email protected]>
Hi there,



I am wondering how I can use an if statement to switch between different objective functions.

For example, how do I represent the following:





If (StatusFlag_X == 1 && StatusFlag_Y == 0) then

      minimize cost: sum{i in I, j in J} c[i,j] * x[i,j];

end if



If (StatusFlag_X == 0 && StatusFlag_Y == 1) then

      minimize cost: sum{i in I, j in J} c[i,j] * x[i,j] + d[i,j] * Y[i,j];

end if



Both are mutually exclusive, i.e. either you do one or the other, i.e. both objective functions will never be activate at the same time



This is what I used to do in "mosel" language from FICO Xpress (I don't have a license anymore so I am discovering GLPK ). How can I do this in GLPK language? What's the workaround that we can use for this?



Many thanks in advance for your help. It's really appreciated.



Kind regards,

Manuel.