-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconverter.cpp
55 lines (46 loc) · 1.16 KB
/
converter.cpp
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
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <unordered_map>
#include "soccerCSV.h"
using namespace std;
/*
1.Passing acc for P(i) PassAC(i)
2.Shoot acc for P(i) ShotAC(i)
3.flow centrality(Play performance) FC(i)
4.pass(arc) centrality AC(i)->(for every )
*/
class Path{
int current_total;
vector<int> path;
Path(){current_total=0;}
};
int main(int argc, char* argv[]){
string buffer;
int nLine=0;
if(argc != 2){
cout << "Too much input parameter" << endl;
exit(0);
}
else{
ifstream infile(argv[1]);
if(!infile.is_open()){
cout << "Cannot find the file" << endl;
exit(0);
}
else{
vector<int> player;
unordered_map<unsigned int, Player* > player_hash; //hashing player's number to Player class;
while(getline(infile,buffer)){ //Read line by line
nLine++;
SoccerCSV data_in(buffer); //convert a line of CSV raw file into CSV class
//ScanPlayerPOS(data_in, player_hash);
data_in.print();
}
infile.close();
cout << "Process " << nLine << " lines."<< endl;
}
}
return 0;
}