将具有特定需求的MPSSP(多期间单采购问题)转换为AMPL中的随机需求

时间:2019-04-01 07:28:45

标签: optimization ampl stochastic

因此,我建立了一个模型来优化具有特定需求的多周期单采购问题(请参阅附件的DET_DAT.dat文件)。

该程序有效并解决了我想要的问题。但是,从某种意义上说,我想将需求更改为“随机”需求-可以说-3或5种具有适用概率的不同“情景”。

# PARAMETERS

param n; # numbers of customers
param m; # numbers of facilities
param T; # numbers of periodes
param S; # number of scenarios / probabilities
param UnitHoldingCost; # 1

param AssignmentCost{i in 1..n, j in 1..m}; # Assignment cost

param demand{s in 1..S,i in 1..n}; # Demand for i'te customers
param Capacity{j in 1..m}; # Capacity for j'te faciliti

param probability{s in 1..S};
param sigma{t in 1..T};

# DECISION VARIABLES

var Assignment{s in 1..S,i in 1..n, j in 1..m} binary; # the assignment in period t for customer i for faciliti j
var Production{t in 1..T, j in 1..m} >= 0; # production in period t for the j'te faciliti
var ProduceorNot{t in 1..T,j in 1..m} binary; # if the j'te faciliti produce or not
var Inventory{t in 0..T,j in 1..m} >= 0; # the inventory for period t

# OBJECTIVE FUNCTION

minimize Total_Cost: sum{s in 1..S,t in 1..T,i in 1..n,j in 1..m} probability[s] * Assignment[s,i,j]*sigma[t]*demand[s,i]*AssignmentCost[i,j] + sum{t in 1..T,j in 1..m} UnitHoldingCost*Inventory[t,j]; 

# CONSTRAINTS

    subject to BalanceConstraint {s in 1..S,t in 1..T, j in 1..m} :
    Production[t,j]+Inventory[t-1,j] = sum{i in 1..n} sigma[t]*demand[s,i]*Assignment[s,i,j]+Inventory[t,j];

    subject to ProductionConstraint {t in 1..T,j in 1..m} :
    Production[t,j] <= Capacity[j]*ProduceorNot[t,j];

    subject to AllCustomersAssignedConstraint {s in 1..S,t in 1..T,i in 1..n} :
    sum{j in 1..m} Assignment[s,i,j] = 1;

    subject to Inventoryat0Constraint {j in 1..m}:
    Inventory[0,j] = 0;

您可以在“ STOC_xxx.xxx”文件中看到完整的代码和数据。 (在这里:https://wetransfer.com/downloads/3d80a82ed433024ceb3c090517ff580b20190401072514/23f481

在NEOS男爵求解器上运行它们时出现以下错误: https://neos-server.org/neos/jobs/6730000/6738289.html

“ ....

Presolve消除了4个约束和4个变量。 调整后的问题: 432个变量:     384个二进制变量     48个线性变量 636个约束,全部线性; 4572非零     612个平等约束     24个不平等约束 1个线性物镜; 384个非零值。

BARON 18.5.8(2018.05.08):线程= 4 BARON 18.5.8(2018.05.08):1次迭代,不可行

....“

有人可以告诉我我的方法有什么问题吗?

最好的问候, 彼得

0 个答案:

没有答案