公交调度可视化调研4--建模 | 青训营笔记
这是我参与「第五届青训营 」伴学笔记创作活动的第 15 天
(仅供自己参考,技术点请看字节整理的资料和相应官方技术文档)
这是前端项目系列里的第4篇《公交调度可视化调研4》
- 场景:
早高峰时段,南沙某段地铁broke,需要公交车接驳
公交总站
- 东涌湖公交总站
- 黄阁公交总站(黄阁汽车城)
- 蕉门公交总站(蕉门)
Sets and Indices
: index and set of passengers (aka jobs) (todo: 乘客的数量远大于车站的量)
: index and set of vehicles (aka technicians) 理论上一个车次为一个k
: Index and set of depots (service centers), where is the number of depots.
: index and set of locations to visit.
: index and set of bus stops
Parameters
乘客属性
the origin stop and end stop of passenger p
the arrival time of passenger p(指乘客到达origin stop的时间) (后续有期待到达时间$$)
路网属性(暂时不考虑cost)
distance between stop i and j,
the width (number of lanes) of
车辆属性(暂时不考虑cost)
velocity of vehicle k
capacity of vehicle k 载客量
Decision Variables
重要!!!乘客--车辆一一对应
: This variable is equal 1 if passenger is assigned to vehicle , and 0 otherwise
This variable is equal 1 if technician is used to perform a job, and 0 otherwise. 车辆k是否被使用
This variable is equal 1 if vehicle travels from location to location , and 0 otherwise 重要!!!表示车辆k是否要走某条路arc ij
: This variable determines the time passenger onboard
: This variable determines when the vehicle arrives at stop
: This variable is equal 1 if passenger can be served, and 0 otherwise
- ? 乘客实际到达时间,理论上就是
- 车次变量、发车时间变量
Objective Function
-
时间:乘客等待时间最短
the waiting time of a passenger equals to the onboard time minus arrival time, if a passenger cannot be served, given a large penalty
Constraints
-
(1) Assign vehicles: For each passenger, we assign one vehicle, or a gap is declared
Note: The penalty of the gap variable which is a large number to discourage not being able to satisfy demand.
-
(2) Only one vehicle: For each passenger, we only allow one vehicle to be assigned(感觉1,2一样)
-
(3) Vehicle capacity: for each vehicle, we ensure that the available capacity of the vehicle is not exceeded
-
(4) Vehicle tour: for each vehicle and passenger, we ensure that if the vehicle k is assigned to the passenger whose origin stop is , then the vehicle must travel to another location (to form a tour) 如果一辆车从stop i到stop j,说明这两车一定在stop i 接客;并且从stop i 只会有一个出度(对于车K来说)
-
(5) For each vehicle and passenger, we ensure that if a vehicle k is assigned to a passenger whose origin stop is , then the vehicle must travel from another location to the location of the passenger (to form a tour) 对于车K的运行路线,在stop j 只有1个入度
-
(6,7 不太符合实际或者兼容实际)Same depot: For each vehicle and depot, we ensure that a vehicle, if assigned to any passengers, must depart from and return to the service center (depot) where the vehicle is based.
-
(8) Temporal relationship: For each vehicle and depot, we ensure the temporal relationship between two consecutive passengers served by the same vehicle. That is, if a vehicle travels from passenger to passenger , then the start of the service time at passenger must be no less than the completion time of passenger plus the travel time from passenger to passenger
For each vehicle and its route stops, we ensure the temporal relationship between two consecutive stops. That is, if a vehicle travels from stop to stop , then the start of the arrival time at stop must be no less than the completion time of stop plus the travel time from stop to stop
(completion time暂时设一个default constant value, 还可以设置为一个正比例于上车人数的值)
-
(9感觉时间上的限制需要再仔细想想) Time window: For each passenger ensure that the time window for the passenger is satisfied
-
两个ot变量的关系