mini fix
This commit is contained in:
parent
e63c31a3e3
commit
59b6e40e4a
|
|
@ -1,10 +1,19 @@
|
|||
from MazeSolver.Solver import MazeSolver
|
||||
from .strat.
|
||||
import csv
|
||||
|
||||
def run_benchmark(maze, strategies, repeats = 5):
|
||||
def RunBenchmark(maze, strategies, repeats = 5):
|
||||
rows = []
|
||||
|
||||
for name, strategies in strategies.items():
|
||||
for name, strategy in strategies.items():
|
||||
|
||||
solver = MazeSolver(maze, strategy)
|
||||
|
||||
for _ in range(repeats):
|
||||
stats, _ = solver.solve()
|
||||
|
||||
rows.append([name, stats.time_ms, stats.visited_cells, stats.path_length])
|
||||
|
||||
with open("results.csv", "w", newline="") as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(["strategy", "time_ms", "visited", "path_length"])
|
||||
writer.writerows(rows)
|
||||
3
pomelovsd/ExitMaze/Observer_Command/Observer.py
Normal file
3
pomelovsd/ExitMaze/Observer_Command/Observer.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class Observer:
|
||||
def update(self, event):
|
||||
pass
|
||||
26
pomelovsd/ExitMaze/main.ipynb
Normal file
26
pomelovsd/ExitMaze/main.ipynb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "66bfd079",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from Builder.Builder import TextFileMazeBuilder\n",
|
||||
"from Core.Benchmark import RunBenchmark\n",
|
||||
"from Core.Cell import Cell\n",
|
||||
"from Core.Maze import Maze\n",
|
||||
"from MazeSolver.SearchStats import SearchStats\n",
|
||||
"from MazeSolver.SearchStats import SearchStats"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user