-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtwelve_generator.py
More file actions
145 lines (115 loc) · 3.9 KB
/
twelve_generator.py
File metadata and controls
145 lines (115 loc) · 3.9 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import random
import json
import sys
data = 0
with open('./training_data/data.txt') as json_data:
data = json.load(json_data)
targets = 0
with open('./training_data/targets.txt') as json_data:
targets = json.load(json_data)
#0 rated people
def saver_big_months(num):
MI = data[num][0];
ME = data[num][1];
TI = data[num][2];
RCS = data[num][3];
Age = data[num][4];
TA = data[num][5];
price = 10000;
yearly_income = []
for i in range (0,11):
monthly_income = MI + (random.randint(-1,1) * (MI/100))
monthly_expenditure = (random.randint(7,9)*0.1) * monthly_income
TI += ( monthly_income - ((random.randint(3,45)*0.01) * monthly_income)) - monthly_expenditure
yearly_income.append([monthly_income,monthly_expenditure,TI]);
return yearly_income
#1 rated people
def saver_small_months(num):
MI = data[num][0];
ME = data[num][1];
TI = data[num][2];
RCS = data[num][3];
Age = data[num][4];
TA = data[num][5];
price = 10000;
yearly_income = []
for i in range (0,11):
monthly_income = MI + (random.randint(-1,1) * (MI/100))
monthly_expenditure = (random.randint(1,3)*0.1) * monthly_income
TI += ( monthly_income - ((random.randint(3,8)*0.01) * monthly_income)) - monthly_expenditure
yearly_income.append([monthly_income,monthly_expenditure,TI]);
return yearly_income
#2 rated people
def poor_big_months(num):
MI = data[num][0];
ME = data[num][1];
TI = data[num][2];
RCS = data[num][3];
Age = data[num][4];
TA = data[num][5];
price = 10000;
yearly_income = []
for i in range (0,11):
monthly_income = MI + (random.randint(-1,1) * (MI/100))
monthly_expenditure = (random.randint(8,11)*0.1) * monthly_income
TI += ( monthly_income - ((random.randint(50,70)*0.01) * monthly_income)) - monthly_expenditure
yearly_income.append([monthly_income,monthly_expenditure,TI]);
return yearly_income
#3 rated people
def average_months(num):
MI = data[num][0];
ME = data[num][1];
TI = data[num][2];
RCS = data[num][3];
Age = data[num][4];
TA = data[num][5];
price = 10000;
yearly_income = []
for i in range (0,11):
monthly_income = MI + (random.randint(-1,1) * (MI/100))
monthly_expenditure = (random.randint(4,7)*0.1) * monthly_income
TI += ( monthly_income - ((random.randint(15,35)*0.01) * monthly_income)) - monthly_expenditure
yearly_income.append([monthly_income,monthly_expenditure,TI]);
return yearly_income
def main():
input0 = sys.argv[1]
input1 = int(input0)
if input1 == 0:
startNum = random.randint(0,1000)
indexNum = targets.index(2,startNum)
print(saver_big_months(indexNum))
elif input1 == 1:
startNum = random.randint(0,1000)
indexNum = targets.index(1,startNum)
print(saver_small_months(indexNum))
elif input1 == 2:
startNum = random.randint(0,1000)
indexNum = targets.index(0,startNum)
print(poor_big_months(indexNum))
else:
startNum = random.randint(0,1000)
indexNum = targets.index(3,startNum)
print(average_months(indexNum))
main()
"""print("save and big spender")
firstzero = targets.index(2)
secondzero = targets.index(2,firstzero+1)
print(firstzero)
print(secondzero)
print(saver_big_months(firstzero))
print(saver_big_months(secondzero))
print("save and small spender")
firstone = targets.index(1)
secondone = targets.index(1,firstone+1)
print(saver_small_months(firstone))
print(saver_small_months(secondone))
print("poor and big spender")
firsttwo = targets.index(0)
secondtwo = targets.index(0,firsttwo+1)
print(poor_big_months(firsttwo))
print(poor_big_months(secondtwo))
print("average spender")
firstthree = targets.index(3)
secondthree = targets.index(3,firstthree+1)
print(average_months(firstthree))
print(average_months(secondthree))"""