This repository has been archived on 2026-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
2026-rff_mp/pomelovsd/ExitMaze/MazeSolver/Solver.py
2026-05-22 23:58:06 +03:00

20 lines
498 B
Python

from SearchStats import SearchStats
import time
class MazeSolver:
def __init__(self, maze, strategy):
self.maze = maze
self.strategy = strategy
def setStrategy(self, strategy):
self.strategy = strategy
def solve(self):
start = time.perf_counter()
path, visited = self.strategy.findPath(self.maze, self.maze.start, self.maze.exit)
end = time.perf_counter()
return SearchStats((end-start)*1000, visited, len(path)), path