-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-test.js
More file actions
57 lines (54 loc) · 1.29 KB
/
Copy pathindex-test.js
File metadata and controls
57 lines (54 loc) · 1.29 KB
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
var assert = require('assert')
exports['test'] = function(){
problem = {
"nbResources": 2,
"jobs": [
{
"jobId": "Job01",
"origLat": "38.674921",
"origLon": "-9.175401",
"destLat": "38.716860",
"destLon": "-9.162417",
"minStartTime": "13:00",
"maxEndTime": "14:15",
"pickupDuration": 5,
"deliveryDuration": 5,
"cargoId": "Fernando Pessoa",
"consumptions": [
0,
1
]
}
],
"vehicles": [
{
"vehicleId": "12-AS-46",
"depotLat": "38.806842",
"depotLon": "-9.382556",
"minStartTime": "07:00",
"maxEndTime": "22:00",
"maxWorkDuration": 540,
"capacities": [
2,
3,
],
"breaks": [
{
"breakId": "Lunch",
"minStartTime": "12:00",
"maxEndTime": "14:00",
"duration": 60
}
],
"overspeed": 1.25
}
]
}
kangrouter=require("./index.js")
api=kangrouter(process.env.API_KEY,process.env.LICENSE_ID)
api.solve(problem)
.done(function(solution){
assert.equal(solution["type"],"total")
assert.equal(solution["jobsScheduled"].length,1)
})
};