-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
49 lines (37 loc) · 1.08 KB
/
main.py
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
import os
import sys
from State import State
ClassLabel = {
"NoLabel" : "0",
"Meal_Preparation" : "1",
"Relax" : "2",
"Eating" : "3",
"Work" : "4",
"Sleeping" : "5",
"Wash_Dishes" : "6",
"Bed_to_Toilet" : "7",
"Enter_Home" : "8",
"Leave_Home" : "9",
"Housekeeping" : "10",
"Respirate" : "11"
}
LastState = State()
NewState = State()
directory = os.path.dirname(sys.modules['__main__'].__file__)
outputDataset = open(directory+"/Dataset/OutPut", "w")
with open(directory+"/Dataset/data", "r") as Dataset:
LastState.textParser(Dataset.readline())
for line in Dataset:
NewState.textParser(line)
if(NewState == LastState):
LastState.textParser(line)
continue
for s in range(0, (NewState - LastState)):
LastState.writeState(outputDataset)
LastState.incrementTime()
LastState.writeState(outputDataset)
LastState.textParser(line)
Dataset.close()
LastState.writeState(outputDataset)
outputDataset.close()
print("#outputDataSet's line: ", LastState.counter)