-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
82 lines (66 loc) · 1.92 KB
/
main.py
File metadata and controls
82 lines (66 loc) · 1.92 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
"""
This is the main.py
"""
# import matplotlib
# matplotlib.use('Agg')
import utils.toolbox as toolbox
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import matplotlib.animation as anim
import random
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import time
from matplotlib import style
import utils.CardUtils as cu
import os, sys
style.use('fivethirtyeight')
#
# fig = plt.figure()
# ax1 = fig.add_subplot(1,1,1)
def expect(tp, ts):
xar = np.arange(len(ts))
yar = [tp] # theoretical_probabilities
zar = [ts[0]] # simulation_probabilities
for i in range(1, len(ts)):
yar.append(tp * (i + 1))
zar.append(zar[i - 1] + ts[i])
ax1.plot(xar, yar)
ax1.plot(xar, zar)
def draw_histgram(diff, window_size, bin_size):
index = window_size
x = []
while (index <= len(diff)):
# if index == window_size:
x.append(np.max(diff[index - window_size:index]))
index += window_size
n, bins, patches = plt.hist(x, bin_size, facecolor='blue', alpha=0.5)
if __name__ == '__main__':
x = 1
while (True):
x += 1
print(x)
time.sleep(1)
"""
Current task is to check whether the random sequence is agreeable with the expected value
"""
# generate the data
# batch_size = 36
# batch_num = 800
# model = [ "MT" ]
# result = toolbox.generate_ts(batch_size, batch_num, model)
# print(result.shape)
# models = [ "MT", "hardware" ]
folder = "function_test"
# models = ["LCG25.txt", "LCG15.txt" ]
models = [ "Real_Game3_month.txt", "Real_Game1_year.txt"]
# models = [ "HALTON.txt" ]
tp = cu.theoretical_probabilities
window_size = 5
bin_size = 25
for model in models:
toolbox.draw_feature_distribution(folder, model, toolbox.BOTH, window_size, bin_size)
#
# fig, ax = plt.subplots(15, 2, figsize=(30, 100))
# plt.show()