-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotting.py
More file actions
64 lines (58 loc) · 2.41 KB
/
plotting.py
File metadata and controls
64 lines (58 loc) · 2.41 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
import matplotlib.pyplot as plt
class Plotting:
@staticmethod
def plot_inventory_over_time(simulator):
plt.figure(figsize=(10, 5))
plt.plot(simulator.time_axis, simulator.amount_axis, marker='o', linestyle='-', color='b')
plt.title('Ending Inventory - Shortage Over Time')
plt.xlabel('Time (Days)')
plt.ylabel('Amount')
plt.grid(True)
plt.show()
@staticmethod
def plot_showroom_over_time(simulator):
plt.figure(figsize=(10, 5))
plt.plot(simulator.time_axis, simulator.amount_axis2, marker='o', linestyle='-', color='b')
plt.title('Ending Showroom - Shortage Over Time')
plt.xlabel('Time (Days)')
plt.ylabel('Amount')
plt.grid(True)
plt.show()
@staticmethod
def plot_combined_over_time(simulator):
plt.figure(figsize=(10, 5))
plt.plot(simulator.time_axis, simulator.amount_axis3, marker='o', linestyle='-', color='b')
plt.title('Ending Inventory + Ending Showroom - Shortage Over Time')
plt.xlabel('Time (Days)')
plt.ylabel('Amount')
plt.grid(True)
plt.show()
@staticmethod
def plot_inventory_showroom_levels(simulator):
plt.figure(figsize=(12, 6))
plt.plot(range(1, simulator.num_days + 1), simulator.ending_inventory_list, label='Ending Inventory')
plt.plot(range(1, simulator.num_days + 1), simulator.ending_showroom_list, label='Ending Showroom')
plt.xlabel('Day')
plt.ylabel('Inventory Level')
plt.title('Inventory and Showroom Levels Over Time')
plt.legend()
plt.grid(True)
plt.show()
@staticmethod
def plot_histogram_inventory(simulator):
plt.figure(figsize=(10, 5))
plt.hist(simulator.ending_inventory_list, bins=20, color='blue', edgecolor='black')
plt.title('Histogram of Ending Inventory Levels')
plt.xlabel('Ending Inventory Level')
plt.ylabel('Frequency')
plt.grid(True)
plt.show()
@staticmethod
def plot_histogram_showroom(simulator):
plt.figure(figsize=(10, 5))
plt.hist(simulator.ending_showroom_list, bins=20, color='green', edgecolor='black')
plt.title('Histogram of Ending Showroom Levels')
plt.xlabel('Ending Showroom Level')
plt.ylabel('Frequency')
plt.grid(True)
plt.show()