[2]task2
This commit is contained in:
parent
61908239da
commit
9ff0e6aa20
50
romanovpv/task 2/docs/data/graphs.py
Normal file
50
romanovpv/task 2/docs/data/graphs.py
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
from result import results
|
||||
|
||||
df = pd.DataFrame(
|
||||
results[1:],
|
||||
columns=results[0]
|
||||
)
|
||||
|
||||
time_data = df.pivot(
|
||||
index="maze",
|
||||
columns="strategy",
|
||||
values="time_ms"
|
||||
)
|
||||
|
||||
time_data.plot(kind="bar")
|
||||
|
||||
plt.title("Время выполнения")
|
||||
plt.ylabel("мс")
|
||||
plt.xticks(rotation=0)
|
||||
|
||||
plt.show()
|
||||
|
||||
cells_data = df.pivot(
|
||||
index="maze",
|
||||
columns="strategy",
|
||||
values="cells visited"
|
||||
)
|
||||
|
||||
cells_data.plot(kind="bar")
|
||||
|
||||
plt.title("Количество посещённых клеток")
|
||||
plt.ylabel("клетки")
|
||||
plt.xticks(rotation=0)
|
||||
|
||||
plt.show()
|
||||
|
||||
path_data = df.pivot(
|
||||
index="maze",
|
||||
columns="strategy",
|
||||
values="path length"
|
||||
)
|
||||
|
||||
path_data.plot(kind="bar")
|
||||
|
||||
plt.title("Длина пути")
|
||||
plt.ylabel("шаги")
|
||||
plt.xticks(rotation=0)
|
||||
|
||||
plt.show()
|
||||
BIN
romanovpv/task 2/docs/Отчет.docx
Normal file
BIN
romanovpv/task 2/docs/Отчет.docx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user