我收到 java.lang.IllegalStateException: moveThreadIndex (0) 的移动线程引发了异常。在父线程这里中继,moveThreadIndex(0)的move线程抛出了异常。在父线程中中继。
我正在尝试访问不同实体的 getArrivalTime 以到达相关实体的就绪时间。我正在使用 VRP 示例。这是从 afterEntityAdded 和 afterEntityChanged 的 UpdateListener 调用的。在 PRODUCTION 模式下也是如此。
private Long calculateArrivalTime(ScoreDirector scoreDirector, Task Task, Long previousDepartureTime) {
if (Task == null || Task.getPreviousStandstill() == null) {
return null;
}
long readyTime = Task.getReadyTime();
if (Task.getGroupType().equalsIgnoreCase("NONGPMS") && Task.getIsMegaTask() == false) {
ResourceRoutingSolution sol = (ResourceRoutingSolution)scoreDirector.getWorkingSolution();
List<Task> list = sol.getTasks();
for (Task tx : list) {
Task megaTask = (Task)scoreDirector.lookUpWorkingObjectOrReturnNull(tx);
Task nonMegaTask = (Task)scoreDirector.lookUpWorkingObjectOrReturnNull(Task);
if (megaTask.getIsMegaTask() == true && nonMegaTask.getGroupKey().equals(megaTask.getGroupKey())) {
readyTime = megaTask.getArrivalTime() == null ? 0 : megaTask.getArrivalTime();
}
}
}
if (Task.getPreviousStandstill() instanceof Resource) {
// PreviousStandstill is the Resource, so we leave from the Depot at the best
// suitable time
// Helper.logDebug("Depot Ready time: " +
// Helper.CovertEpochSecondsToDateTime(previousDepartureTime).toString());
// Helper.logDebug("Task Ready time: " +
// Helper.CovertEpochSecondsToDateTime(Task.getReadyTime()).toString());
return Math.max(readyTime, previousDepartureTime + Task.getDistanceFromPreviousStandstill());
}
// return (previousDepartureTime == null ? 0 : previousDepartureTime) +
// Task.getDistanceFromPreviousStandstill();
return Math.max(readyTime,
(previousDepartureTime == null ? 0 : previousDepartureTime) + Task.getDistanceFromPreviousStandstill());
}