Skip to content

Delivery Batches from a Store

Business Scenario

In City-A, kStore offers both online shopping platform and physical stores. All online orders are delivered from a central fulfilment center.

All online orders are collected in real time and synchronized to the center to prepare the products. City-A is divided into multiple areas, namely A, B, C, ... According to the location coordinates, each order is classified into one area. If for some reason one order has no area, a special area code E is given.

Each area has its own delivery schedule. For example, Area-A will continuously accept online orders and will follow this delivery schedule everyday:

DeadlineDelivery Window
08:0010:00 - 14:00
14:0016:00 - 20:00

Meanwhile, Area-B will follow this delivery schedule everyday:

DeadlineDelivery Window
06:0007:00 - 09:00
09:0010:00 - 12:00
14:0015:00 - 17:00
17:0018:00 - 20:00

kStore wants to automate and optimze the delivery dispatching process. The objects are:

  1. Provide optimized delivery plan for each worker, so that the truck can be loaded in reversed order of delivery and the driver can easily follow an optimized plan, rather than planning by himself.
  2. Users should have access to the realtime delivery plan to know when exactly their packages are arriving.

Technical Details

The Integration should be through APIs, rather than interactions on web pages.

All codes in this example can be found here:

Prerequisite

  1. You should already have a Kandbox Dispatch Account.

To plan your jobs in Kandbox Dispatch platform, please follow those steps:

Execute the Example Python Program in one go

The first step is to clone the repository to your local computer:

sh
git clone https://github.com/li-jinbao/kdclient

Then install the required packages to your python environment:

sh
cd kdclient
pip install -r requirements.txt

Configure the required environment variables with the information you have registered to Kandbox Dispatch:

sh
# export server_url=http://_server_url_/kd/api/v1
# export email=_email_@email.com
# export password=_pass_
# export team_code=_team_

Then you can run the london_simple demo program by:

sh
python ./src/sg_multi_batch.py

After the program finish, you should be able to view the planned route in the Web UI.