IBM ILOG CPLEX 由于“forall”部分出现内存不足错误

问题描述 投票:0回答:0

我正在研究一个数学模型,我的复杂代码可以在底部看到。当我开始运行这个模型时,30 分钟后出现“内存不足错误”,模型说这个错误的问题在这两个“forall”部分。你能帮我通过改变这个foralls来减少内存的使用吗?谢谢。

此约束给出错误:

forall (m in MachineType, i in ProductType, p in PolishingType,t in TimePeriod, u in (2..A[i]*D[m][p]):(t+u <=maxT)) 
  (- x[m][t][i][p] + x[m][t+1][i][p] - x[m][t+u][i][p]) <=0;

forall (m in MachineType, p1 in PolishingType, p2 in PolishingType:p1!=p2, t in TimePeriod, i in ProductType, u in TimePeriod:u==S /*[m][p1][p2]*/&&(t+u <=maxT)) 
  x[m][t+u][i][p2] <= 1-x[m][t][i][p1];

/*********************************************
 * OPL 22.1.1.0 Model
 * Author: User
 * Creation Date: May 1, 2023 at 2:12:46 PM
 *********************************************/
int NMachineType=...; //M-m
int NPolishingType=...; //P-p
int NProductType=...; //İ-i 
int NTimePeriod=...; //T-t
int maxT=32400;//Toplam Çalışma Süresi
float BigM=99999999999; 
int S=97;//97 saniye 
range MachineType=1..NMachineType;
range PolishingType=1..NPolishingType;
range ProductType=1..NProductType;
range TimePeriod=1..NTimePeriod;


int  Q[ProductType]=...; //i ürününden sipariş edilen miktar
int A[ProductType]=...; //i ürününün polisajda işlem alanı
dvar boolean J[MachineType][PolishingType]; //m makinesinin p türü polisaj işini yapabiliyorsa 1, yapamıyorsa 0 değerini alan gösterge kümesi
int IP[ProductType][PolishingType]=...;// i ürünün görmesi gereken polisaj aşamaları dvar 
int D[MachineType][PolishingType]=...; //m makinesinin p türü polisaj işini yapma süresi
//int S[MachineType][PolishingType][PolishingType]; //m makinesinde p_1 türü polisaj işinden p_2 türü polisaja geçişte makine ayar süresi 
dvar boolean x[MachineType][TimePeriod][ProductType][PolishingType]; //1,m" makinesine " t" zamanında " i" ürününün " p" tür polisajına atanır" otherwise=0

minimize sum(m in MachineType, t in TimePeriod, i in ProductType, p in PolishingType) (t* x[m][t][i][p]);

subject to 
{
  forall (m in MachineType, t in TimePeriod) sum(i in ProductType,p in PolishingType) x[m][t][i][p] <=1;
  
  forall (m in MachineType, i in ProductType, p in PolishingType, t in (2..A[i]*D[m][p])) (x[m][1][i][p]-x[m][t][i][p]) <=0;
  
  forall (m in MachineType, i in ProductType, p in PolishingType,t in TimePeriod, u in (2..A[i]*D[m][p]):(t+u <=maxT)) 
  (- x[m][t][i][p] + x[m][t+1][i][p] - x[m][t+u][i][p]) <=0;
  
  forall (m in MachineType, i in ProductType, p in PolishingType, t in 2..(A[i]*D[m][p])) (x[m][maxT][i][p]-x[m][maxT-t][i][p]) <=0;
  
  forall (m in MachineType, p in PolishingType) sum(i in ProductType, t in TimePeriod) x[m][t][i][p] <= BigM * J[m][p];
  
  forall (i in ProductType, p in PolishingType:p==IP[i][p]) sum(m in MachineType, t in TimePeriod) x[m][t][i][p] >=1;//== D[m][p];
  
  forall (m in MachineType, p1 in PolishingType, p2 in PolishingType:p1!=p2, t in TimePeriod, i in ProductType, u in TimePeriod:u==S /*[m][p1][p2]*/&&(t+u <=maxT)) 
  x[m][t+u][i][p2] <= 1-x[m][t][i][p1];
  
  }

我试图停用这两个部分,但程序没有继续。

cplex ibm-ilog-opl
© www.soinside.com 2019 - 2024. All rights reserved.