forked from UNN/2026-rff_mp
20 lines
499 B
Python
20 lines
499 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 |