示例#1
0
        static public void OutputResult()
        {
            StreamReader reader    = new StreamReader("tabels.txt");
            Algoritm     algoritm  = new Algoritm();
            int          count     = 0;
            long         sec       = 0;
            Stopwatch    stopwatch = new Stopwatch();

            using (StreamWriter writer = new StreamWriter("out.txt"))
            {
                for (int i = 0; i < 5; i++)
                {
                    string     str = reader.ReadLine();
                    List <int> lst = new List <int>(str.Split(' ').Select(int.Parse));
                    tabelGame          = lst;
                    algoritm.TabelGame = tabelGame;
                    stopwatch.Start();
                    resh = algoritm.AStar();
                    stopwatch.Stop();
                    id     = resh.Count;
                    count += id;
                    sec   += stopwatch.ElapsedMilliseconds;
                    writer.Write("Time - {0}, Count - {1}, Len(cost) - {2}, Memory(MB) - {3}", stopwatch.ElapsedMilliseconds, id, len, memory);
                    stopwatch.Reset();
                    writer.WriteLine();
                }
                writer.WriteLine(count / 5 + " " + sec / 5);
            }
            reader.Close();
        }
示例#2
0
        private void StartAlghoritm()
        {
            Algoritm algoritm = new Algoritm();

            algoritm.TabelGame      = tabelGame;
            algoritm.ChooseAlgoritm = algFind;
            resh           = algoritm.AStar();
            id             = 0;
            timer1.Enabled = true;
        }