示例#1
0
 private void Button_Click_8(object sender, RoutedEventArgs e)
 {
     if (url == null)
     {
         //Alert msg
         MessageBox.Show("Please import file.");
     }
     else
     {
         var instance1 = new FCFS();
         instance1.SortProcess(ObjList, row, result);
         var instance2 = new PS_NP();
         instance2.SortProcess(ObjList, totalTime, row, result);
         var instance3 = new SJF_NP();
         instance3.SortProcess(ObjList, totalTime, row, result);
         var instance4 = new RR();
         instance4.SortProcess(ObjList, totalTime, row, result);
         var instance5 = new PS_P();
         instance5.SortProcess(ObjList, totalTime, row, result);
         var instance6 = new SJF_P();
         instance6.SortProcess(ObjList, totalTime, row, result);
         var instance7 = new Analysis();
         output.Text += $"\n\n============== Anatysis All Algorithm ==============\n";
         output.Text += $"{instance7.AnalysisResult(result)}";
         output.Text += $"\n\n===========================================\n";
         result       = new List <Result>();
     }
 }
示例#2
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     if (url == null)
     {
         //Alert msg
         MessageBox.Show("Please import file.");
     }
     else
     {
         var instance1 = new FCFS();
         output.Text += $"\n\n First Come First Serve : {instance1.SortProcess(ObjList, row, result)}";
     }
 }
示例#3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (rdFCFS.Checked == true)
            {
                FCFS fcfs = new FCFS();
                fcfs.Numpro = Convert.ToInt32(txtNum.Text.Trim());
                fcfs.Max    = Convert.ToInt32(txtMax.Text.Trim());
                fcfs.Min    = Convert.ToInt32(txtMin.Text.Trim());
                fcfs.Show(); this.Hide();
                if (checkRan.Checked == true)
                {
                    fcfs.ran = true;
                }
                fcfs.populate();
            }

            if (rdPQ.Checked == true)
            {
                PQ pq = new PQ();
                pq.Numpro = Convert.ToInt32(txtNum.Text.Trim());
                pq.Max    = Convert.ToInt32(txtMax.Text.Trim());
                pq.Min    = Convert.ToInt32(txtMin.Text.Trim());
                pq.Show(); this.Hide();
                if (checkRan.Checked == true)
                {
                    pq.ran = true;
                }
                pq.populate();
            }

            if (rdSJF.Checked == true)
            {
                SJF sjf = new SJF();
                sjf.Numpro = Convert.ToInt32(txtNum.Text.Trim());
                sjf.Max    = Convert.ToInt32(txtMax.Text.Trim());
                sjf.Min    = Convert.ToInt32(txtMin.Text.Trim());
                sjf.Show(); this.Hide();
                if (checkRan.Checked == true)
                {
                    sjf.ran = true;
                }
                sjf.populate();
            }
        }