-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cpp
114 lines (114 loc) · 2.71 KB
/
test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//#include"CardParase.h"
//#include"dataModel.h"
//#include<iostream>
//#include<fstream>
//#include<string>
//#include<vector>
//#define SIZE 40000
//#define INPUTFILE "C:\\Users\\root\\Desktop\\TensorFlow\\¾«×¼×ÊÖú\\train\\card_train10.txt"
//#define OUTPUTFILE "C:\\Users\\root\\Desktop\\TensorFlow\\¾«×¼×ÊÖú\\train\\testOutput.txt"
//
//using namespace std;
//vector<string> inputRecord;
//bool isRepeated(string str);
//DataModel* student[SIZE];
//
//int main(){
// ifstream file = ifstream(INPUTFILE, ios::in | ios::binary);
// string str;
// int cnt = 0;
// Date globalDate;
// globalDate.year = 2013;
// globalDate.mon = 9;
// globalDate.day = 1;
// globalDate.weekday = 7;
//
// if (!file){
// cout << "file open fail" << endl;
// return 0;
// }
//
//
// while (getline(file, str)){
// if (isRepeated(str)){
// continue;
// }
//
// Card card(str);
//
// if (card.consume != "POSÏû·Ñ"){
// continue;
// }
// Date* date = card._date;
// while (globalDate.year != date->year || globalDate.mon != date->mon || globalDate.day != date->day){
// globalDate = globalDate.nextDay();
// }
// date->weekday = globalDate.weekday;
//
// if (student[card.id] == NULL){
// student[card.id] = new DataModel();
// }
// student[card.id]->consume(date->mon, card.money, card.remain, card.good, date->weekday);
//
// cnt++;
// if ((cnt % 3000) == 0){
// cout << cnt << endl;
// }
// if (cnt == 200000) break;
// }
//
// file.close();
//
// cnt = 0;
// ofstream of = ofstream(OUTPUTFILE, ios::out | ios::binary);
// for (int i = 0; i < SIZE; i++){
// if (student[i] != NULL){
// of << i << ' ';
// DataModel* data = student[i];
// for (int j = 0; j < 12; j++){
// of << data->getAvgConsume(j) << ' ';
// }
// for (int j = 0; j < 12; j++){
// of << data->getAvgRemain(j) << ' ';
// }
// for (int j = 0; j < 12; j++){
// of << data->getConsumeTime(j) << ' ';
// }
// for (int j = 0; j < 12; j++){
// of << data->getGoodConsume(j,data->Good[7]) << ' ';
// }
// for (int j = 0; j < 12; j++){
// of << data->getGootTime(j,data->Good[7]) << ' ';
// }
// for (int j = 0; j < 12; j++){
// of << data->getMaxConsume(j) << ' ';
// }
// for (int j = 0; j < 12; j++){
// of << data->getWeekendCnt(j) << ' ';
// }
// for (int j = 0; j < 12; j++){
// of << data->getWeekendConsume(j) << ' ';
// }
// of << endl;
// cnt++;
// }
//
// if (cnt >= 100) break;
// }
// of.close();
//}
//
//bool isRepeated(string str){
// vector<string>::iterator it;
// it = find(inputRecord.begin(), inputRecord.end(), str);
// if (it == inputRecord.end()){
// if (inputRecord.size() > 10){
// inputRecord.erase(inputRecord.begin());
// }
// return false;;
// }
// else{
// inputRecord.erase(it);
// return true;
// }
//}