-
Notifications
You must be signed in to change notification settings - Fork 0
/
simulator.py
122 lines (89 loc) · 3.67 KB
/
simulator.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
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
import matplotlib.pyplot as plt
import seaborn as sns
import random as random
w, h = 18, 52
locations_picked_100 = [[0 for x in range(h)] for y in range(w)]
w1, h1 = 18, 27
locations_picked_200 = [[0 for x in range(h1)] for y in range(w1)]
max_A = 7179
max_B = 4054
max_C = 5564
current_A = 0
current_B = 0
current_C = 0
max_placed_pallets = 41038
max_pallets = 0
loc_x = 0
for i in locations_picked_100:
curr_loc_y = 0
for j in i:
distribution_A = random.randint(8,15)
distribution_B = random.randint(3,9)
distribution_C = random.randint(1,4)
if curr_loc_y > 0 and loc_x < 10 and (loc_x + 1) % 2 == 0:
locations_picked_100[loc_x][curr_loc_y] = distribution_A * 5
max_pallets += distribution_A * 5
current_A += 1
if curr_loc_y > 0 and loc_x < 10 and (loc_x + 1) % 2 != 0:
locations_picked_100[loc_x][curr_loc_y] = distribution_B * 5
max_pallets += distribution_B * 5
current_B += 1
if curr_loc_y > 0 and loc_x >= 10 and (loc_x + 1) % 2 != 0:
locations_picked_100[loc_x][curr_loc_y] = distribution_C * 3
max_pallets += distribution_C * 3
current_C += 1
if curr_loc_y > 0 and loc_x >= 10 and (loc_x +1) % 2 == 0:
locations_picked_100[loc_x][curr_loc_y] = distribution_B * 5
max_pallets += distribution_B * 5
current_B += 1
if curr_loc_y == 0:
locations_picked_100[loc_x][curr_loc_y] = distribution_C * 2
max_pallets += distribution_C * 2
current_C += 1
curr_loc_y += 1
loc_x += 1
loc_x = 0
for i in locations_picked_200:
curr_loc_y = 0
for j in i:
distribution_A = random.randint(4,12)
distribution_B = random.randint(3,6)
distribution_C = random.randint(1,5)
if curr_loc_y > 0 and loc_x < 10 and (loc_x + 1) % 2 == 0:
locations_picked_200[loc_x][curr_loc_y] = distribution_A * 5
max_pallets += distribution_A * 5
current_A += 1
if curr_loc_y > 0 and loc_x < 10 and (loc_x + 1) % 2 != 0:
locations_picked_200[loc_x][curr_loc_y] = distribution_B * 5
max_pallets += distribution_B * 5
current_B += 1
if curr_loc_y > 0 and loc_x >= 10 and (loc_x + 1) % 2 != 0:
locations_picked_200[loc_x][curr_loc_y] = distribution_C * 2
max_pallets += distribution_C * 2
current_C += 1
if curr_loc_y > 0 and loc_x >= 10 and (loc_x +1) % 2 == 0:
locations_picked_200[loc_x][curr_loc_y] = distribution_B * 5
max_pallets += distribution_B * 5
current_B += 1
if curr_loc_y == 0:
locations_picked_200[loc_x][curr_loc_y] = distribution_C * 2
max_pallets += distribution_C * 2
current_C += 1
curr_loc_y += 1
loc_x += 1
print(current_A, current_B, current_C, max_pallets)
fig, ax = plt.subplots()
plt.title("Picked/Stored in 100-aisle (Y-axis) and location in aisle (X-axis)")
heatplot1 = sns.heatmap(locations_picked_100, annot=True, fmt="d",
xticklabels=range(1,53), yticklabels=range(1,19), robust = True,
)
heatplot1.invert_yaxis()
heatplot1.invert_xaxis()
plt.figure()
plt.title("Picked/Stored in 200-aisle (Y-axis) and location in aisle (X-axis)")
heatplot1 = sns.heatmap(locations_picked_200, annot=True, fmt="d",
xticklabels=range(1,28), yticklabels=range(1,19), robust = True,
)
heatplot1.invert_yaxis()
heatplot1.invert_xaxis()
plt.show()