コード例 #1
0
        private void Get_Min_Visier_Data(string str1, string str2)
        {
            Queue <int> Qu1 = grp1.Get_Min_Vister_BFS_Traversal(str1, str2);
            int         index;
            int         n = Qu1.Dequeue();
            int         m;
            long        time     = 0;
            long        day      = 0;
            long        end_time = 0;

            dataGridView3.Rows.Clear();
            while (Qu1.Count > 0)
            {
                m     = n;
                n     = Qu1.Dequeue();
                index = dataGridView3.Rows.Add();
                dataGridView3.Rows[index].Cells[0].Value = grp1.IDToName(m);
                dataGridView3.Rows[index].Cells[1].Value = grp1.IDToName(n);
                if (end_time > grp1.Get_Go_Time(m, n))
                {
                    day++;
                }
                time     = grp1.Get_Go_Time(m, n) + day * 24 * 60;
                end_time = grp1.Get_Trans_Time(m, n) + grp1.Get_Go_Time(m, n);
                dataGridView3.Rows[index].Cells[2].Value = Min_To_Time(time);
                time += grp1.Get_Trans_Time(m, n);
                dataGridView3.Rows[index].Cells[3].Value = Min_To_Time(time);
                dataGridView3.Rows[index].Cells[4].Value = Min_To_Time(grp1.Get_Trans_Time(m, n));
                dataGridView3.Rows[index].Cells[5].Value = grp1.Get_Money(m, n) + "元";
                dataGridView3.Rows[index].Cells[6].Value = grp1.Get_Road_Trans(m, n);
            }
        }