예제 #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_7(object sender, RoutedEventArgs e)
 {
     if (url == null)
     {
         //Alert msg
         MessageBox.Show("Please import file.");
     }
     else
     {
         var instance4 = new RR();
         output.Text += $"\n\n Round Robin : {instance4.SortProcess(ObjList, totalTime, 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 (rdRR.Checked == true)
     {
         RR rr = new RR();
         rr.Numpro = Convert.ToInt32(txtNum.Text.Trim());
         rr.Max    = Convert.ToInt32(txtMax.Text.Trim());
         rr.Min    = Convert.ToInt32(txtMin.Text.Trim());
         rr.Show(); this.Hide();
         if (checkRan.Checked == true)
         {
             rr.ran = true;
         }
         rr.populate();
     }
 }