private void button1_Click(object sender, EventArgs e)
 {
     if (cmbAlgoritmos.Text == "ROUND ROBIN")
     {
         //this.Close();
         RoundRobin formRound = new RoundRobin();
         formRound.Show();
         this.Hide();
     }
     else if (cmbAlgoritmos.Text == "PRIORIDADE")
     {
         Prioridade formPrio = new Prioridade();
         formPrio.Show();
         this.Hide();
     }
     else if (cmbAlgoritmos.Text == "MÚLTIPLAS FILAS")
     {
         MultiplasFilas formMul = new MultiplasFilas();
         formMul.Show();
         this.Hide();
     }
     else if (cmbAlgoritmos.Text == "JOB MAIS CURTO")
     {
         JobMaisCurto formJob = new JobMaisCurto();
         formJob.Show();
         this.Hide();
     }
     else if (cmbAlgoritmos.Text == "SORTEIO")
     {
         Sorteio formSor = new Sorteio();
         formSor.Show();
         this.Hide();
     }
     else if (cmbAlgoritmos.Text == "GARANTIDO")
     {
         MessageBox.Show("Em Desenvolvimento.");
     }
 }
Beispiel #2
0
        public void MultiplasFilasEsc(processo[] p1, processo[] p2, processo[] p3, int[] quantum, String[] algoritmos)
        {
            RoundRobin round = new RoundRobin();

            if ((p3.Length) != 0)
            {
                if (algoritmos[2] == "ROUND ROBIN")
                {
                    txbSimulacao.Text += "------------- ALTA PRIORIDADE ----------" + Environment.NewLine;
                    RoundRobinEsc(quantum[2], p3);
                }
                else if (algoritmos[2] == "JOB MAIS CURTO")
                {
                    txbSimulacao.Text += "------------- ALTA PRIORIDADE ----------" + Environment.NewLine;
                    JobMaisCurtoEsc(p3);
                }
                else
                {
                    txbSimulacao.Text += "------------- ALTA PRIORIDADE ----------" + Environment.NewLine;
                    SorteioEsc(p3);
                }
            }

            if (p2.Length != 0)
            {
                if (algoritmos[1] == "ROUND ROBIN")
                {
                    txbSimulacao.Text += "------------- MÉDIA PRIORIDADE ----------" + Environment.NewLine;
                    RoundRobinEsc(quantum[1], p2);
                }
                else if (algoritmos[1] == "JOB MAIS CURTO")
                {
                    txbSimulacao.Text += "------------- MÉDIA PRIORIDADE ----------" + Environment.NewLine;
                    JobMaisCurtoEsc(p2);
                }
                else
                {
                    txbSimulacao.Text += "------------- MÉDIA PRIORIDADE ----------" + Environment.NewLine;
                    SorteioEsc(p2);
                }
            }

            if (p1.Length != 0)
            {
                if (algoritmos[0] == "ROUND ROBIN")
                {
                    txbSimulacao.Text += "------------- BAIXA PRIORIDADE ----------" + Environment.NewLine;
                    RoundRobinEsc(quantum[0], p1);
                }
                else if (algoritmos[0] == "JOB MAIS CURTO")
                {
                    txbSimulacao.Text += "------------- BAIXA PRIORIDADE ----------" + Environment.NewLine;
                    JobMaisCurtoEsc(p1);
                }
                else
                {
                    txbSimulacao.Text += "------------- BAIXA PRIORIDADE ----------" + Environment.NewLine;
                    SorteioEsc(p1);
                }
            }
        }