CPLEX OPL中的多期间生产批次调整模型

时间:2019-03-14 10:43:50

标签: mathematical-optimization cplex opl

我是最后一年的学生,并且是CPLEX OPL编程语言的完全新手。我一直在为饮料公司的批量产品设计模型。我考虑了一个基于GLSP的小型存储桶模型,每个宏周期都具有基于设置更改的灵活的微周期。

该模型假设一个具有3条生产线和3个混合槽的2阶段过程。我未能在CPLEX代码中表示以下项目。

  1. 每个宏周期中的微周期集
  2. 从产品 i 到产品 j
  3. 的转换
  4. 从MS Excel中读取一组字符串数据。

我在模型中引用的学术论文位于Academic Paper for the Model

有没有人可以帮助我将论文中的数学转换为CPLEX OPL?

到目前为止,以下是我用于声明模型变量和参数的代码

/*********************************************
 * OPL 12.5 Model
 * Author: HENRY
 * Creation Date: Mar 9, 2019 at 7:30:27 PM
 *********************************************/
//Model Parameters
int M = 4;
int F = 4;
int T = 5;
int N = 15;
int J = 4;
{int} micro_periods = {1,2,3};
{int} periods = {1,2,3,4,5};

tuple micro_period {
   int micro1;
   int micro2;
   int micro3;
}

micro_period St[periods] = ...;//set of microperiods in period t

{string}machnes = {"line1","line2","line3"};

{string} lambda_j = ...;//set of lines that can produce item j
{string} alpha_m = ...;//set of items that can be produced on line m
{string} beta_m = ...;//set of liquid flavours that can be produced on tank m
{string} gamma_ml = ...;//set of items that can be produced on line m and need liquid flavour l

//ranges in the model
range products = 1..J;
range machines = 1..M;
range flavours = 1..F;
//range periods = 0..T-1;
//range micro_periods = 1..N; //total number of setups

tuple itm {
    string line1;
    string line2;
    string line3;
  }
//itm lambda_j[products] = ...;

tuple flvr {
    string O;
    string A;
    string F;
    string P;
  }
//flvr beta_m[machines] = ...;

tuple lin {
    string MA;
    string MO;
    string MF;
    string PP;
  }
//lin alpha_m[machines] = ...;

tuple gamma {
    string line;
    string flavor;
  }

//gamma gamma_ml[machines][flavours] = ...;//revist this one

//Data Variables
float djt[products][periods] = ...;
float hj[products] = ...;
float gj[products] = ...;
float aIImj[machines][products] = ...;
float KIm[machines] = ...;//total capacity of tank m
float KIImt[machines][periods] = ...;//total available time 
float rjl[products][flavours] = ...;
float qIm[machines] = ...;
float Ipj[products] = ...;//initial inventory of item j
float Imj[products] = ...;//inital back order of item j
//boolean yIml0[machines][flavours] = ...;
//boolean yIImj0[machines][products] = ...;

tuple flvr_edge {
    int k;
    int l;  
}
tuple prdt_edge {
    int i;
    int j;  
}
//sets in the model
setof(flvr_edge)flvrs = {<k,l> | k,l in flavours : k!=l};
float sIkl[flvrs] = ...;
float bIkl[flvrs] = ...;

setof(prdt_edge) prdts = {<i,j> | i,j in products: i!=j};
float sIIij[prdts] = ...;
float bIIij[prdts] = ...;

//Decision variables
dvar float+ Ipjt[products][periods];
dvar float+ Imjt[products][periods];
dvar float+ xIImjs[machines][products][micro_periods];
dvar float+ vIIms[machines][micro_periods];
dvar boolean yImls[machines][flavours][micro_periods];
dvar boolean yIImjs[machines][products][micro_periods];
dvar boolean zImkls[machines][flvrs][micro_periods];
dvar boolean zIImijs[machines][prdts][micro_periods];

1 个答案:

答案 0 :(得分:0)

您将在[InstallDir]/opl/examples/opl中找到许多OPL示例。 https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.ide.help/OPL_Studio/opllanguser/topics/opl_languser_shortTour.html中提供了OPL的介绍。