How to Enforce a Specific Starting Point for a Vehicle in VROOM

54 views Asked by At

I'm implementing a delivery routing system using VROOM and I need to control the starting point in which a driver picks up orders from different restaurants. The driver, referred to as Vehicle 1, is already at Al Abdallah store to pick up an order and have additional pickups ready at other restaurants.

Initial scenario: Vehicle 1 is expected to start from Al Abdallah and then proceed to pick up an order at Pizzanini, as its delivery location is close to Al Abdallah's client.

Request Body:

{
    "vehicles": [
        {
            "id": 1,
            "description": "Shopper in store (Al Abdullah)",
            "capacity": [2],
            "max_tasks": 4,
            "start": [35.573740, 33.903584],
            "steps": [
                {
                    "type": "pickup",
                    "id": 1
                },
                {
                    "type": "delivery",
                    "id": 2
                }
            ]
        }
    ],
    "shipments": [
        {
            "pickup": {
                "id": 1,
                "description": "Al Abdullah order",
                "location": [35.573740, 33.903584]
            },
            "delivery": {
                "id": 2,
                "description": "Al Abdullah client",
                "location": [35.591753, 33.896119]
            },
            "amount": [1]
        },
        {
            "pickup": {
                "id": 5,
                "description": "Wooden Bakery order",
                "location": [35.573233, 33.903196]
            },
            "delivery": {
                "id": 6,
                "description": "Wooden Bakery client",
                "location": [35.581014, 33.905217]
            },
            "amount": [1]
        },
        {
            "pickup": {
                "id": 7,
                "description": "Malak Al Tawouk order (near wooden bakery)",
                "location": [35.576267, 33.903813]
            },
            "delivery": {
                "id": 8,
                "description": "Malak Al Tawouk client (near wooden bakery)",
                "location": [35.580511, 33.906136]
            },
            "amount": [1]
        },
        {
            "pickup": {
                "id": 9,
                "description": "Pizzanini order",
                "location": [35.578701, 33.899912]
            },
            "delivery": {
                "id": 10,
                "description": "Pizzanini client",
                "location": [35.598503, 33.897005]
            },
            "amount": [1]
        }
    ]
}

Expected behavior: The driver begins the route at Al Abdallah and then heads to Pizzanini. Expected behavior

Actual behavior: However, the driver is initiating the route from Wooden Bakery and then proceeding to pick up an order from Malak Tawouk. Actual behavior

How can I ensure that VROOM prioritizes the driver's starting point at Al Abdallah and follows the expected pickup order?

0

There are 0 answers