private static void Run() { /* * int testTime = 4; * double allTime = 0f; * for (int i = 0; i < testTime; i++) * { * // Test the algorithm * Console.WriteLine("迷路生成中..."); * var map = MazeCreator.Create(51, 51, new Vec2(2, 2)); * Console.WriteLine(" 生成完了.\n"); * var algorithm = new HeatingSearcher(map); * * double elapsedMs1 = Timer.ElapsedMilliSec(); * algorithm.Solve(); * double elapsedMs2 = Timer.ElapsedMilliSec(); * * allTime += elapsedMs2 - elapsedMs1; * } * Console.WriteLine("Average Time: " + allTime / (double)testTime);*/ var map = MazeCreator.Create(21, 21, new Vec2(2, 2)); map.Dump(); Console.WriteLine(); double t1 = Timer.ElapsedMilliSec(); var algorithm = new Dijkstra(map); double t2 = Timer.ElapsedMilliSec(); Console.WriteLine("Elapsed Time: " + (t2 - t1)); //var searcher = new ParallelHeatingSearcher(map); }
//`````````````````````````````````````````````````````````````````````````````````````````````````````````` //`````````````````````````````````````````````````````````````````````````````````````````````````````````` void Start() { //creation of maze matrix at start var maze = MazeCreator.Create(height, width); Draw(maze); }
public void Create(MazeCreator creator) { creator.Create(width, height, Field); }