문제

Given two decision variable d1,d2 that take in only number 0 and 1 if the objective function is the sum of them we can express it by

Term t1=d1 + d2;
 model.AddGoal("goal", GoalKind.Maximize,t1);

Now I wish to take the smaller of them, i.e. Term

I want to write an objective function where

Math.min(d1,d2)

How to express the Math.min here?

도움이 되었습니까?

해결책

The Model class contains a substantial set of relevant mathematical operations in the form of static methods, for example Min.

You could simply write:

Term t1 = Model.Min(d1, d2);

and you are good to go :-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top