-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph_heuristics.py
51 lines (42 loc) · 1.56 KB
/
graph_heuristics.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
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from IPython.display import display, HTML
groups = 7
heuristic_agent_values = []
id_improved_values = []
labels = ('Random', 'MM_Null', 'MM_Open', 'MM_Improved', 'AB_Null', 'AB_Open', 'AB_Improved')
index = np.arange(groups)
bar_width = 0.35
def plot_graphs_tables(id_improved_values, versus_values, heuristic_values, versus_values_h, label):
data = {'ID_Imrpoved Agent Wins (Out of 20)': id_improved_values, 'Heuristic Agent Wins (Out of 20)': heursitic_values}
df = pd.DataFrame(data)
display(df)
id_improved_values = id_improved_values
versus_values = versus_values
plt.bar(index, id_improved_values, bar_width,
color='b',
label='ID_Improved Agent')
plt.bar(index + bar_width, versus_values, bar_width,
color='r')
plt.xlabel('Agents')
plt.ylabel('Wins')
plt.title('ID_Improved Agent Vs Other Agents')
plt.xticks(index + bar_width / 2, labels)
plt.rcParams["figure.figsize"] = [20, 5]
plt.legend()
plt.show()
heursitic_values = heursitic_values
versus_values = versus_values_h
plt.bar(index, heursitic_values, bar_width,
color='b',
label='ID_Improved Agent')
plt.bar(index + bar_width, versus_values, bar_width,
color='r')
plt.xlabel('Agents')
plt.ylabel('Wins')
plt.title(label)
plt.xticks(index + bar_width / 2, labels)
plt.legend()
plt.rcParams["figure.figsize"] = [20, 5]
plt.show()