Java 使用分区搜索的VRPTW Optaplanner

Java 使用分区搜索的VRPTW Optaplanner,java,optaplanner,Java,Optaplanner,我已经在VRP问题中实现了分区搜索,效果非常好。然后我尝试实现VRPTW问题。在init进程之后,前一个StandStill的arrivalTime有时为null,并在ArrivalTimeUpdateingVariableListener.java中导致错误,特别是在调用.getDepartureTime()时 Long departureTime = previousStandstill == null ? null : (previousStandstill

我已经在VRP问题中实现了分区搜索,效果非常好。然后我尝试实现VRPTW问题。在init进程之后,前一个StandStill的arrivalTime有时为null,并在
ArrivalTimeUpdateingVariableListener.java
中导致错误,特别是在调用
.getDepartureTime()

Long departureTime = previousStandstill == null ? null
                : (previousStandstill instanceof TimeWindowedCustomer)
                        ? ((TimeWindowedCustomer) previousStandstill).getDepartureTime()
                        : ((TimeWindowedDepot) ((Vehicle) previousStandstill).getDepot()).getReadyTime();

有没有人遇到过和我一样的问题?谢谢您的帮助。

对于输入/输出模型,阴影变量应该与真正的VAR同步

例如,如果C=A+5且A为10,则C应为15。如果A是200,那么C应该是205。如果A为null,那么C应该为null


尝试打开enviromnentMode FULL_ASSERT,它将验证此需求的输入数据。

阴影变量应与输入/输出模型的真实变量同步

例如,如果C=A+5且A为10,则C应为15。如果A是200,那么C应该是205。如果A为null,那么C应该为null


尝试打开enviromnentMode FULL_ASSERT,它将验证此需求的输入数据。

您可能也非常喜欢此问题:谢谢您的帮助。在我跟踪错误后,似乎有些车辆链无法启动到达时间。因此,在这条链中,所有的客户都没有到达时间。然后我创建了计算算法来计算该客户的到达时间。你觉得怎么样?可以吗?你可能也非常喜欢这个问题:谢谢你的帮助。在我跟踪错误后,似乎有些车辆链无法启动到达时间。因此,在这条链中,所有的客户都没有到达时间。然后我创建了计算算法来计算该客户的到达时间。你觉得怎么样?可以吗?
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