如何使用C#在docplex中设置一个四维变量?

问题描述 投票:2回答:1

在C#中调用cplex时如何设置三维变量?

using ILOG.Concert;
using ILOG.CPLEX;

以下为二维:

INumVar[][] EndTime = new INumVar[NumEMU][];
            for (int i = 0; i < NumEMU; i++)
                EndTime[i] = cplexMod1.NumVarArray(NumJob, 0, 1, NumVarType.Int);
c# cplex docplex
1个回答
0
投票
INumVar[][][] x = new INumVar[nb1][][];//creation of i
                for (int i = 0; i < nb2; i++)
                {
                    x[i] = new INumVar[nb2][];//creation of j
                    for (int j = 0; j < nb3; j++)
                    {
                        x[i][j] = new INumVar[nb3];//creation of v
                    }
                }// nb1,nb2,nb3 are integer parameters. 
© www.soinside.com 2019 - 2024. All rights reserved.