Optimization step arrival time and shipment pickup priority

I’m using optimization API, and I 2 problem

  1. I have a shipment with time_window from [3:00 - 11:00], and a vehicle time_window[3:00 - 23:00], the vehicle can reach pickup location at 3:30 maximum, but the result gives me arrivalTime at 10:42, change the time_window for shipment to [3:00 - 3:30], it reaches at 3:30!!
    how can I force the vehicle to reach as early as possible regardless of vehicle driving hours?

  2. Another case I want to handle also using optimization API, having +3 shipments, with 2 different pickup locations, I want to force a vehicle to visit all pickups first, then start delivery
    I saw that I can send “steps” with the vehicle but it didn’t work

sample request using step in vehcile

{
    "shipments": [
        {
            "pickup": {
                "id": 1,
                "location": [
                    39.242778,
                    21.538049
                ],
                "service": 930,
                "time_windows": [
                    [
                        1630213200,
                        1630234800
                    ]
                ],
                "description": "Shipment_4f4e861e"
            },
            "delivery": {
                "id": 2,
                "location": [
                    39.24635,
                    21.5324901
                ],
                "service": 930,
                "time_windows": [
                    [
                        1630213200,
                        1630231200
                    ],
                    [
                        1630299600,
                        1630317600
                    ],
                    [
                        1630386000,
                        1630404000
                    ],
                    [
                        1630472400,
                        1630490400
                    ]
                ],
                "description": "Shipment_4f4e861e"
            }
        },
        {
            "pickup": {
                "id": 3,
                "location": [
                    41.073056,
                    19.124722
                ],
                "service": 930,
                "time_windows": [
                    [
                        1630213200,
                        1630234800
                    ]
                ],
                "description": "Shipment_c1d89766"
            },
            "delivery": {
                "id": 4,
                "location": [
                    39.235461,
                    21.584299
                ],
                "service": 3600,
                "time_windows": [
                    [
                        1630207800,
                        1630234800
                    ],
                    [
                        1630294200,
                        1630321200
                    ],
                    [
                        1630380600,
                        1630407600
                    ],
                    [
                        1630467000,
                        1630494000
                    ]
                ],
                "description": "Shipment_c1d89766"
            }
        }
    ],
    "vehicles": [
        {
            "id": 1,
            "profile": "driving-car",
            "description": "Vehicle type: REEFER",
            "start": [
                39.242778,
                21.538049
            ],
            "time_window": [
                1630213200,
                1632013200
            ],
            "steps": [
                {
                    "type": "start"
                },
                {
                    "id": 1,
                    "type": "pickup",
                    "location": [
                        39.242778,
                        21.538049
                    ]
                },
                {
                    "id": 3,
                    "type": "pickup",
                    "location": [
                        41.073056,
                        19.124722
                    ]
                },
                 {
                    "type": "end"
                }
            ]
        }
    ],
    "options": {
        "g": true,
        "c": true
    }
}

Hi @Rand_Hazem,

we are using vroom for our optimization API.
Please search their issues for an existing solution for your problem and create one if there is none.

Best regards

1 Like