Initial Routes and constraint

there is a little misunderstanding with initial routes.
After creating initial routing, changing arrive and leave time

    VehicleRoutingProblem.Builder vrpBuilder;
    VehicleRoute initialRoute; 
    //My object with detail info about stop (arrive and leave time for example 19:45:00 - 20:00:00)
InitialRoute userRoute;

    List<TourActivity> activities = initialRoute.getTourActivities().getActivities();
    for (TourActivity ta : activities) {
        String id = ((TourActivity.JobActivity) ta).getJob().getId();
        for(Stop stop: userRoute.getServices()) {
            if(id.equals(stop.getId())) {
                Service job = (Service)getJob(id, vrpBuilder);
                if(job != null) {
                    ta.setArrTime(stop.getArrivalTime()); //19:45:00
                    ta.setEndTime(stop.getLeaveTime()); //20:00:00

service time window is 16:30:00 - 20:00:00
real time of arrival for initial route (19:45:00 - 20:00:00) service time is 15 min
in result of optimization, we have a arriving on service in time out of time window ((20:03:00 - 20:18:00))
can you clarify how algoritm work with initial route, why constraint not working in this case ?

Thanks for answer

arrTime and endTime, even theoreticalEarliestOperationStart (if you deal with multiple time windows) is determined by the algorithm. What you can do initially is to determine the start of the route (via the assigned vehicle) as well as the sequence of activities. Available time windows are always specified on job level, thus, you need to assign them to your jobs in advance. Id recommend to useVehicleRoute.Builder` to build an initial route.