-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcost_test.cpp
More file actions
44 lines (34 loc) · 822 Bytes
/
cost_test.cpp
File metadata and controls
44 lines (34 loc) · 822 Bytes
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
#include "Assignment.h"
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
using namespace paras;
int main() {
std::vector<Taxi> schedule;
std::unordered_map<long, Passenger> pass_list;
Passenger pass1;
Passenger pass2;
pass1.id = 1;
pass1.start_x = 0;
pass1.start_y = 0;
pass1.dest_x = 3;
pass1.dest_y = 3;
pass2.id = 2;
pass2.start_x = 1;
pass2.start_y = 1;
pass2.dest_x = 2;
pass2.dest_y = 2;
Taxi taxi1;
taxi1.schedule.push_back(1);
taxi1.schedule.push_back(2);
taxi1.schedule.push_back(-2);
taxi1.schedule.push_back(-1);
taxi1.cur_x = 5;
taxi1.cur_y = 5;
pass_list[1] = pass1;
pass_list[2] = pass2;
schedule.push_back(taxi1);
double cost = Assignment::calculateCost(schedule, pass_list);
std::cout << cost << std::endl;
}