Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (daysInfected > 0)
            {
                daysInfected--;
                label2.Text = "Current\ndays: " + daysInfected.ToString();
                ReadFromFile.Read();
                Queue <char> QueueEdge = new Queue <char>();

                //ReadFromFile.EdgeData is data which contains Data of Edge
                //ReadFromFile.GraphData is data which contains Data of Graph

                this.Controls.Remove(Visualisasi.viewer);
                //Init Graph G sudah di ReadFile
                ReadFromFile.province.printGraph();
                BFS.BFSCompute(daysInfected, ReadFromFile.source);
                BFS.printSol(daysInfected);
                Visualisasi.Visual();

                //associate the viewer with the GUI
                this.SuspendLayout();
                this.Controls.Add(Visualisasi.viewer);
                this.ResumeLayout();
            }
        }
Exemple #2
0
        public static void Main()
        {
            ReadFromFile.Read();
            Queue <char> QueueEdge = new Queue <char>();

            Console.Write("Input Total Days Infected: ");
            int time = Convert.ToInt32(Console.ReadLine());

            //ReadFromFile.EdgeData is data which contains Data of Edge
            //ReadFromFile.GraphData is data which contains Data of Graph

            //Init Graph G sudah di ReadFile
            ReadFromFile.province.printGraph();
            BFS.BFSCompute(time, ReadFromFile.source);
            BFS.printSol(time);
            Visualisasi.Visual();
        }