使用 CP Optimizer 时 CPLEX 内存不足

CPLEX not enough memory when usingCP Optimizer

我正在尝试 运行 COPtimizer,但它有一条错误消息:“内存不足”

我尝试在 16GB RAM 和 16000mb 内存可用于工作区的情况下 运行 它,但错误仍然发生。

是我的条件限制还是我需要更大的内存系统?

在此先感谢您。

这是我的模式:

using CP;
int scale=10;

int NumbDay =...;
int NumbTask =...;

range Day = 1 .. NumbDay;
range Task = 1 .. NumbTask;

int h [Day]=...;
int c [Day]=...;
int d [Day]=...;
int R [Task]=...;
int E [Task]=...;
int O [Task]=...;
float t [Task]=...;

dvar int+ q [Task];
dvar int+ n [Task];
dvar int+ m [Task];
dvar int scaleW[Day] in 0..1000;
dexpr float W [k in Day]=scaleW[k]/scale;
dvar boolean X [Day][Task];

dexpr float e1 = sum(k in Day)(W [k])^2;

dexpr float e2 = sum(i in Task) (q [i]*n[i]*m[i]);

minimize staticLex(e1, e2);
subject to 
{
    constraint_1:
        forall (k in Day){
            sum(i in Task) t [i]*X [k][i] == W [k];
    }  
    constraint_2:
        forall (i in Task){
            sum(k in Day) X [k][i] == 1;
    }
    constraint_3:
        forall (k in Day, i in Task){
            X [k][i] == 0 || X [k][i] == 1;
    }  
    constraint_4:
        forall (i in Task){
            sum(k in Day) X [k][i] * h [k] <= R [i];
    }
    constraint_5:
        forall (k in Day, i in Task){
            q [i] == R [i] - sum(k in Day) X [k][i] * h [k];
    }
    constraint_6:
        forall (i in Task){
            sum(k in Day) X [k][i] * c [k] <= E [i];
    }
    constraint_7:
        forall (k in Day, i in Task){
            n [i] == E [i] - sum(k in Day) X [k][i] * c [k];
    }
    constraint_8:
        forall (i in Task){
            sum(k in Day) X [k][i] * d [k] <= O [i];
    }
    constraint_9:
        forall (k in Day, i in Task){
            m [i] == O [i] - sum(k in Day) X [k][i] * d [k];
    }
}
  1. 能否分享您的 .dat 文件以便其他用户试用?

  2. 移动到 1 个工人可以节省内存

    执行 { cp.param.Workers=1; }