Insertion global impact

I thought the insertion of a new activity has only local impact. After reading some other posts on the forum, there were severel conversations where it was stated that the insertion has global effect.

I was trying to understand this through the constraints of the jsprit core. For example if a new activity is inserted, the activies after that may be shifted, thus there is a chance that the activites after the new one, will be out of their timewindows. But after looking at the TimeWindow constraint in VehicleDependentTimeWindowConstraints, I did not see any code that will deny the insertion in case when shifting happens.

Thanks, Bálint

It’s done by latestArrTimeAtNextAct:

latestArrTimeAtNextAct = states.getActivityState(nextAct, iFacts.getNewVehicle(), InternalStates.LATEST_OPERATION_START_TIME, Double.class);

This is stored in UpdateVehicleDependentPracticalTimeWindows:

stateManager.putInternalTypedActivityState(activity, vehicle, InternalStates.LATEST_OPERATION_START_TIME, latestArrivalTime);

If you check the calculation of latestArrivalTime, you will see it covers what you said.

Best regards,
He