Example #1
0
        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);
        }
Example #2
0
//``````````````````````````````````````````````````````````````````````````````````````````````````````````
//``````````````````````````````````````````````````````````````````````````````````````````````````````````
    void Start()
    {
        //creation of maze matrix at start
        var maze = MazeCreator.Create(height, width);

        Draw(maze);
    }
Example #3
0
 public void Create(MazeCreator creator)
 {
     creator.Create(width, height, Field);
 }