Skip to content

DangHa/commodity_shipping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COMMODITY SHIPPING

(optimising the shipping commodity capacity)

Description

This system was created to help drivers can maximise their income in each their shipment For example: a driver has a plan travelling from Hanoi,Vietnam to HoChiMinh,Vietnam by a 4-seat car. He uses Uber to fill up the three rest seats, but the luggage compartment is still not filled up. This system will help this driver to fill up the rest capacity of the car which means he can optimise the money for each travel.

How it works. If a driver has still 100 (Kg) and 100 (M^3) in his car. He will register these information of this shipment on the system, then those information will be shown for users who has packages to choose if this travel fit with their demand.

The information of 1 shipment consists:
-, Starting point
-, Destination
-, Direction (The system will have a recommender system to helps drivers choose the direction which does not pass the toll plazas in Vietnam, it means reducing the cost of travel)
-, Weight capacity
-, Space capacity
-, Starting day (after this day, the system won't recommend this shipment to users have packages anymore)

  • System Overview

Overview system

Interfaces of 2 mobile apps

  • Driver App

Diagram_driver_app Driver_app_interface

  • User App

Diagram_user_app User_app_interface

Pathfinding recommender system

This recommender system helps drivers to find suitable direction by criteria such as time, length of way and expense

  • Data used by recommender system

    -, The data of Vietnam road system is come from OpenStreetMap and be extracted by geofabrik (geofabrik.de)
    -, The data of Vietnam toll plaza is from some Vietnam newspapers

  • A-star Algorithm

    The pathfinding algorithm is A* algorithm with the cost which be calculated in each node is

        cost = Cost_of_node + h()
      with h() = sqrt(dx) + sqrt(dy) (x, y are earth coordinates of node)
    
  • Value of Cost_of_node

    • influence of length

      Cost_of_node = length
      

    Only find the shortest path. An example of finding a path from Thaibinh city to Hanoi city

    length

    • influence of priority_of_road

      Cost_of_node = length * priority_of_road
      

    -, With priority_of_road is
    priority_of_road = -1.0 when roads are 'steps','footway','pedestrian'
    priority_of_road = 8.0 when roads are 'residential','living_street'
    priority_of_road = 2.5 when roads are 'tertiary'
    priority_of_road = 1.8 when roads are 'secondary', 'secondary_link'
    priority_of_road = 1.5 when roads are 'primary','primary_link','primary_junction'
    priority_of_road = 1.3 when roads are 'trunk','trunk_link','trunk_junction'
    priority_of_road = 1.0 when roads are 'motorway','motorway_junction','motorway_link'

    -> This numbers has been chosen from the attributes of the data of length and h().
    Briefly, length ∈ (0.00001, 9) and h() ∈ (0.0001 -> 5). length is always in this range,no matter node being considered is close to the destination, while the range of h() will be changed

    Now it can be affected by the kind of each road. An example of finding a path from Thaibinh city to Hanoi city

    length*priority_of_road

    The result now is similar to the Google Map

    Google Map

    • influence of price_of_road

      Cost_of_node = length * priority_of_road * (price_highest_of_road/100)^weight
      

    -, price_highest_of_road is come from the BOT_toll_plaza table
    -, weight is from user choose and send to the server
    (weight ∈ [0, 1])

    An example of finding a path from Thaibinh city to Hanoi city. The recommender system's result avoid the direction passing the CT01 (Pháp vân- Cầu giẽ)- a BOT project where you have to pay if you want to go through lengthpriority_of_roadprice_highest_of_road1

    An example of finding a path from Ninhbinh city to Hanoi city (Green way is from recommender system with weight = 1, Blue is from Google Map API. The former runs on the QL1A which doesn't have any toll plaza, while the latter runs CT01 which have 4 toll plazas) lengthpriority_of_roadprice_highest_of_road2

Tools used

- React-native
- Google map API
- nodejs (express)
- postgresql (database)
- Openstreetmap, pgrouting, osm2pgrouting (data)

Tools

How to run

  • Database
    Follow instruction in file 1_README_for_creating-database.md in /api/database_SQL

  • For mobile app
    Install Adroid studio and also set up some environment link (follow instruction to install on ubuntu)

npm install (install library) 
npm start --reset-cache 
npx react-native run-android 
  • For server
npm install (install library) 
npm start
  • For admin interface
npm install (install library) 
npm start 

About

The system optimizes shipping capacity and expenses

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published