如何解决铁路线路规划问题?

How can I solve the railway line planning problem?

我正在写关于铁路客运线路规划问题的论文。我想看看计算铁路网络稳健性的不同方法。由于我没有使用 OPL 的经验,因此我在求解模型时遇到了一些问题。我的主管无法帮助我,我正在拼命寻找可以帮助我正确建立模型的人。该模型应确定暗示哪些线路,以及火车的频率和车厢数量,同时将成本保持在最低水平。

我有以下两个问题: 我有一组边 (E) 和一组潜在线 (L)。我怎么能告诉 OPL,例如,第 1 行由边 1 和边 2 组成。我发现很难 link 这些变量。

我正在使用二元决策变量 x[L][F][C],它分别表示线路、线路频率和车厢数量。我如何告诉模型一个值只乘以 F 的值。例如第三个约束,我想将 F 和 C 的值与 capC 相乘。

int nv = ...;
range V = 1..nv;            //set of stations.

int ne =...;
range E =1..ne;                 //set of edges.

int nf = ...;
range F = 1..nf;            //set of possible frequencies.

int nc = ...;   
range C = 1..nc;            //set of possible carriages.

int nl = ...;
range L = 1..nl;            //set of potential lines.

//Parameters

int capC = ...;             //Capacity per carriage

int w[L] = ...;             //cost for using line l

int fmin[E] = ...;          //min freq per line l 

int fmax[E] = ...;          //max freq per line l

int h[E] = ...;             //Demand edge e

//Decision variable

dvar boolean x[L][F][C];                        

//Objective function
minimize sum(l in L, f in F, c in C) w[l] * x[l][f][c]; 

//Constraints

subject to {
forall (e in E)
  sum(l in L, f in F, c in C) x[l][f][c] >= fmin[e];        //Min edge freq

forall (e in E)
  sum(l in L, f in F, c in C) x[l][f][c] <= fmax[e];        //Max edge freq 

forall (e in E)
  sum(l in L, f in F, c in C) x[l][f][c] * capC >= h[e];  //Transfer all passengers

forall (l in L)
  sum(f in F, c in C) x[l][f][c] <= 1;              //Per line at most 1

关于"I want to multiply the values of F and C with the capC",你试过转

forall (e in E) sum(l in L, f in F, c in C) x[l][f][c] * capC >= h[e]; //Transfer all passengers

进入

forall (e in E) sum(l in L, f in F, c in C) f*c*x[l][f][c] * capC >= h[e]; //Transfer all passengers

?