【发布时间】:2020-12-17 16:17:56
【问题描述】:
我已经在 VRP 问题中实现了分区搜索,并且效果很好。然后我尝试实现 VRPTW 问题。在初始化过程之后,previousStandstill 的到达时间有时为 null,并在 ArrivalTimeUpdatingVariableListener.java 中导致错误,特别是在调用 .getDepartureTime() 时。
Long departureTime = previousStandstill == null ? null
: (previousStandstill instanceof TimeWindowedCustomer)
? ((TimeWindowedCustomer) previousStandstill).getDepartureTime()
: ((TimeWindowedDepot) ((Vehicle) previousStandstill).getDepot()).getReadyTime();
15:34:47.101 [PartThread-2] DEBUG CH step (197), time spent (8548), score (-2init/0hard/-8026964soft), selected move count (247), picked move (TimeWindowedCustomer-350 {null -> TimeWindowedCustomer-222}).
15:34:47.106 [PartThread-1] INFO Construction Heuristic phase (0) ended: time spent (8552), best score (0hard/-8128814soft), score calculation speed (9281/sec), step total (200).
15:34:47.146 [PartThread-2] DEBUG CH step (198), time spent (8593), score (-1init/0hard/-8124288soft), selected move count (248), picked move (TimeWindowedCustomer-164 {null -> Vehicle-51}).
15:34:47.200 [PartThread-2] DEBUG CH step (199), time spent (8647), score (0hard/-8138330soft), selected move count (249), picked move (TimeWindowedCustomer-72 {null -> TimeWindowedCustomer-270}).
15:34:47.203 [PartThread-2] INFO Construction Heuristic phase (0) ended: time spent (8650), best score (0hard/-8138330soft), score calculation speed (9196/sec), step total (200).
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
previousStandstill arrivalTime is null
有人遇到过和我一样的问题吗?感谢您的帮助。
【问题讨论】:
标签: java optaplanner