Websphere 如何在IBM ILOG CPLEX Optimization Studio上使用SOS2

Websphere 如何在IBM ILOG CPLEX Optimization Studio上使用SOS2,websphere,cplex,sos,Websphere,Cplex,Sos,请帮帮我。我正在使用IBM ILOG CPLEX Optimization Studio来解决我的问题,我的模型中的一些变量是SOS2类型的。我不知道如何在IBM ILOG CPLEX上使用SOS2。这取决于您使用的API 通过docplex python API,让我分享来自 给 nbBus30 = 3.0 nbBus40 = 4.0 nbBus50 = 1.0 The minimum cost is 3750.0 and then with sos2 nbbus30,nbb

请帮帮我。我正在使用IBM ILOG CPLEX Optimization Studio来解决我的问题,我的模型中的一些变量是SOS2类型的。我不知道如何在IBM ILOG CPLEX上使用SOS2。

这取决于您使用的API

通过docplex python API,让我分享来自

nbBus30  =  3.0
nbBus40  =  4.0
nbBus50  =  1.0
The minimum cost is  3750.0
and then with sos2   nbbus30,nbbus40,nbbus50
nbBus30  =  0
nbBus40  =  7.0
nbBus50  =  1.0
The minimum cost is  4050.0
nbBus30  =  3.0
nbBus40  =  4.0
nbBus50  =  1.0
The minimum cost is  3750.0
and then with sos2   nbbus30,nbbus40,nbbus50
nbBus30  =  0
nbBus40  =  7.0
nbBus50  =  1.0
The minimum cost is  4050.0