简体   繁体   English

隐含边界处的所有条目 CPLEX

[英]all entries at implied bounds CPLEX

  1. I have a set of cars with scheduled time originaltime[cars] to arrive at destination.我有一组预定时间originaltime[cars]到达目的地的汽车。 However, based on the sequence of arrival, they have to be some time apart (given by data input separate[cars][cars] ).但是,根据到达的顺序,它们必须相隔一段时间(由数据输入separate[cars][cars]给出)。
  2. My objective is to minimize the delay of the cars from the original time while respecting the necessary separation.我的目标是在尊重必要间隔的同时,尽量减少汽车从原始时间开始的延误。
  3. The cars can only come 60seconds before their scheduled time originaltime[cars] and 1800seconds after.汽车只能在预定时间originaltime[cars]之前 60 秒和之后 1800 秒到达。
  4. I fix the sequence to enforce first-come-first-served based on their scheduled time originaltime[cars]我根据他们的预定时间originaltime[cars]修复了执行先到先得的顺序

It should be a straight forward implementation, however i encountered problems with some entries at implied bounds.它应该是一个直接的实现,但是我在隐含边界处遇到了一些条目的问题。 I looked at my input data and constraints and I am really not sure why.我查看了我的输入数据和约束,我真的不知道为什么。

I've written the CPLEX code below for my attempts at the problem.我已经编写了下面的 CPLEX 代码来尝试解决这个问题。 Thank you for helping in advance.感谢您提前提供帮助。

//index of the cars considered
{string} cars = ...;
//original scheduled time
int originaltime[cars] = ...;
//time separation apart based on arrival sequence
int separation[cars][cars] = ...;
//decision variables
//the modified time to minimized the delays
dvar float assignedtime[cars];
//the earliest and latest time the cars can arrive
dvar float earliesttime[cars];
dvar float latesttime[cars];
//0-1 variable to specify the order of the cars
dvar boolean order[cars][cars];
//to measure the delay of each car
dvar float indvdelay[cars];
//decision expression to calculate objective ( separated them because I've simplified the problem)
dexpr float objcost[f in cars] = indvdelay2[f];
dexpr float totalobjcost = sum(f in cars) objcost[f];
dexpr float overallobjcost = (1.3*totalobjcost); 
//objective functionn
minimize
    overallobjcost;    
//constraints;
subject to{ 
//obj remove modulus constraint (to account for +/- delay numbers so that it is always positive)
    forall(f in cars)
      indvdelay[f] >= assignedtime[f] -originaltime[f];
    forall(f in arrflights)
      indvdelay[f] >= -(assignedtime[f] -originaltime[f]);  
//earliest and latest times
    forall(f in cars)
      earliesttime[f] == (originaltime[f]-60);
    forall(f in cars)
      latesttime[f] == (originaltime[f] + 1800);  
//constraint to set order precedence based on original time FCFS
  forall(i in cars)
    forall(j in cars: i!=j)
      ctest:(originaltime[j] - originaltime[i])<= (100000*order[i][j] - 0.0005);
  forall(i in cars)
    forall(j in cars: i!=j)
      ctest1b:(originaltime[j] - originaltime[i])>= (-100000*(1-order[i][j]));
      
//order precedence
  forall( i in cars)
    forall(j in cars: i == j)
      ctAA:order[i][j] == 0;
  forall( i in cars)
    forall(j in cars: j > i)
      ctBB:order[i][j] + order[j][i] == 1;    
 //separation 
  forall(i in cars)
    forall(j in cars: i != j)
      ctCC:assignedtime[j] >= assignedtime[i] + separation[i][j] - (100000*(1-order[i][j]));
 //time window constraint 
  forall(f in cars)
    ctDD:assignedtime[f] >= earliesttime[f];
  forall(f in cars)
    ctEE:assignedtime[f] <= latetesttime[f];
      }    

data file code数据文件代码

SheetConnection sheet("stage2errortest.xlsx");
cars from SheetRead(sheet,"'ARR'!B2:B25");
originaltime from SheetRead(sheet,"'ARR'!C2:C25");
separation from SheetRead(sheet,"'septable1arr'!A1:X24");

assignedttime to SheetWrite(sheet,"'ARR'!E2:E25");
indvdelay to SheetWrite(sheet,"'ARR'!F2:F25");

I've included the excel datafile exceldata file我已经包含了 excel 数据文件exceldata 文件

The message "all entries at implied bounds" means that the problem instance is infeasible and that CPLEX was able to prove that in presolve.消息“隐含边界处的所有条目”表示问题实例不可行,并且 CPLEX 能够在 presolve 中证明这一点。 You can use the conflict refiner to investigate this and figure out the reason for this infeasibility.您可以使用冲突优化器对此进行调查并找出不可行的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM