Hackhathon Getir 2018

It is a project developed for BiTaksi Getir Hackathon 2018. Detailed information can be found from below.

Team Paketci!

image

Check our app from here which is deployed using heroku.

Check github repo of app from here

Timeline of our little project!

Getir Hackhathon 2018
Team Members:
Sertan Sezgin Kutlu
Ertuğrul Çınar
Mehmet Ozan Ünal

Paketci App

Its a work on pack collection and delivery for courier and observer.

Features:

By Backend:
1.Assign routes for couries by relate most efficent path.
2.Update states of packets.
3.Update states of couriers.

By Frontend
1.Courier see waypoints and pack to collect.
2.Observers see all couriers and pack states.
3.Adding new packs

Used Libraries and API in frontend

1.Android Libraries
2.Java
3.Volley
4.Google Maps Directions API
5.Google Maps Javascript API
6.AngularJS

Compleated Part of Frontend

Application is designed for used by cariers. It gave users to see which way courier should go and where to take packs.

In order to make it more stable, decions of disturbution made at backend in order to keep system stable for all users, this app communacte with backend by using asyncrounous http requests.

For async HTTPS requess, it been used Volley library in JSON Object and String responsed GET and POST requests.

App takes missions from backend and by communicating with Google Direcitons API, get caluclations of every shorth path waypoints which collect and carry pointed packs in missions and drawing them on a Map View.

In angular web app we see all packs and couriers with their missions and routes. Its allows users to add new packs to environment.

BACKEND

enter image description here
Data structure and Crud Outputs
Sample JSON files, it can be enchance according to packet number and courier number

/api/courier

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
[   {
"_id": 0,
"initLocation": {
"lat": 40.73726833204571,
"long": -111.86816435821093
},
"curLocation": {
"lat": 40.73726833204571,
"long": -111.86816435821093
},
"weightCapacity": 20,
"remainingWeightCapacity": 18.2923904630732,
"pieceCapacity": 8,
"remainingPieceCapacity": 7,
"routes": [
{
"_id": 1,
"routeFromGoogle": "",
"distance": 0.02248501759660298,
"startLoc": {
"lat": 40.73726833204571,
"long": -111.86816435821093
},
"endLoc": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"nearPacketsDistance": [
-1
],
"state": 1
},
{
"_id": 3,
"routeFromGoogle": "",
"distance": 0.01372524844602735,
"startLoc": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"endLoc": {
"lat": 40.745843583374935,
"long": -111.84162666621344
},
"nearPacketsDistance": [
-1
],
"state": 1
}
],
"packets": [
{
"_id": 0,
"initLocation": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"destLocation": {
"lat": 40.745843583374935,
"long": -111.84162666621344
},
"weight": 1.707609536926801,
"state": 1,
"courier": {}
}
] } ]

/api/packet

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[
{
"_id": 0,
"initLocation": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"destLocation": {
"lat": 40.745843583374935,
"long": -111.84162666621344
},
"weight": 1.707609536926801,
"state": 1,
"courier": {}
}
]

/api/route

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[   {
"_id": 0,
"routeFromGoogle": "",
"distance": 0.027888779677731172,
"startLoc": {
"lat": 40.73726833204571,
"long": -111.86816435821093
},
"endLoc": {
"lat": 40.745843583374935,
"long": -111.84162666621344
},
"nearPacketsDistance": [
-1
],
"state": 0 }, {
"_id": 1,
"routeFromGoogle": "",
"distance": 0.02248501759660298,
"startLoc": {
"lat": 40.73726833204571,
"long": -111.86816435821093
},
"endLoc": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"nearPacketsDistance": [
-1
],
"state": 1 }, {
"_id": 2,
"routeFromGoogle": "",
"distance": 0,
"startLoc": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"endLoc": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"nearPacketsDistance": [
-1
],
"state": 0 }, {
"_id": 3,
"routeFromGoogle": "",
"distance": 0.01372524844602735,
"startLoc": {
"lat": 40.73287234594392,
"long": -111.84611325115227
},
"endLoc": {
"lat": 40.745843583374935,
"long": -111.84162666621344
},
"nearPacketsDistance": [
-1
],
"state": 1 } ]

Route Optimization

enter image description here
Firstly, every courier has a route to common destination point. Then most efficient package route change apply. It’s calculated with change of route distance according to package location. It will iterate until no package will left. But according to courier capacities, some of package can be over couriers’ capacities; so you need to go second round.

1
2
3
4
5
6
7
8
9
10
11
"dependencies": {
"body-parser": "~1.18.2",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.15.5",
"mathjs": "^3.20.2",
"point-line-distance": "^1.0.0",
"google_directions": "^0.6.0",
"polyline": "^0.2.0",
"request": "^2.83.0"
}
Paylaş