GRBModel.addSOS()
GRBModel.addSOS()
对模型添加一个SOS约束。Please refer to theSOS Constraintssection in the Reference Manual for additional details.
GRBSOS | addSOS( | GRBVar[] | vars, |
double[] | weights, | ||
int | type ) |
-
Arguments:
vars: Array of variables that participate in the SOS constraint.
weights: Weights for the variables in the SOS constraint.
type: SOS type (can beGRB.SOS_TYPE1orGRB.SOS_TYPE2).
Return value:
New SOS constraint.