private void button1_Click(object sender, EventArgs e)
        {
            int Customers_Number = int.Parse(textBox1.Text);

            dataGridView1.RowCount = Customers_Number;

            dataGridView1.Columns[0].Name = "Customer Number";
            dataGridView1.Columns[1].Name = "Inter-Arrival Time";
            dataGridView1.Columns[2].Name = "Arrival Time";
            dataGridView1.Columns[3].Name = "Server Name";
            dataGridView1.Columns[4].Name = "Start Time";
            dataGridView1.Columns[5].Name = "Service Duration";
            dataGridView1.Columns[6].Name = "End Time";
            dataGridView1.Columns[7].Name = "Delay";

            Customers[] list = new Customers[Customers_Number];

            Servers L = new Servers();
            string sl;

            int last_customer_arrival = 0;

            for (int i = 0; i < Customers_Number; i++)
            {

                // step 1 generate inter arrival time
                list[i].Generate_Inter_Arrival_Time();

                // step 2 set arrival time
                list[i].Set_Arrival_Time(last_customer_arrival);
                last_customer_arrival = list[i].Get_Arrival_Time();

                // step 3  server select
             //   list[i].Server_selector(L);
                list[i].Set_Start_Time(list[i].Get_Delay());
                list[i].Set_End_Time();

                sl = list[i].Get_Server_Name();

                if ( sl.Equals("Able"))
                    L.Set_Able_Finish_Time(list[i].Get_End_Time());
                else
                    L.Set_Baker_Finish_Time(list[i].Get_End_Time());

                // Customer Number column
                dataGridView1[0, i].Value = i + 1;

                // Inter-Arrival Time column
                dataGridView1[1, i].Value = list[i].Get_Arrival_Time();

                // Arrival Time column
                dataGridView1[2, i].Value = list[i].Get_Arrival_Time();

                // Server Name column
                dataGridView1[3,i].Value = list[i].Get_Server_Name();

                // Start Time column
                dataGridView1[4,i].Value = list[i].Get_Start_Time();

                // Service Duration column
                dataGridView1[5,i].Value = list[i].Get_Service_Duration();

                // End Time column
                dataGridView1[6,i].Value = list[i].Get_End_Time();

                // Delay Time Column
                dataGridView1[7,i].Value = list[i].Get_Delay();

            }
        }
        public void Server_selector(Servers s)
        {
            if (s.Get_Able_Status() == false && s.Get_Baker_Status() == true)
            {
                 // baker is free

                s.Set_Baker_with(false);
                Set_Server_Name("Baker");
                s.Generate_Baker_Service_Time();
                Set_Service_Duration(s.Get_Baker_Service_Time());

            }

            else if (s.Get_Able_Status() == false && s.Get_Baker_Status() == false)
            {

                int min = Math.Min(s.Get_Able_Finish_Time(), s.Get_Baker_Finish_Time());

                       if (min == s.Get_Able_Finish_Time())
                         {   // able will finish earlier
                                 s.Set_Able_With(false);
                                 Set_Server_Name("Able");
                                 s.Generate_Able_Service_Time();
                                 Set_Service_Duration(s.Get_Able_Service_Time());
                                 Set_Delay ( ( min - Get_Arrival_Time()) ) ;
                         }

                      else
                         {    // baker will finish earlier
                                 s.Set_Baker_with(false);
                                 Set_Server_Name("Baker");
                                 s.Generate_Baker_Service_Time();
                                 Set_Service_Duration(s.Get_Baker_Service_Time());
                                 Set_Delay((min - Get_Arrival_Time()));
                         }

                   }
              else
               {                                       // able is free
                s.Set_Able_With(false);
                Set_Server_Name("Able");
                s.Generate_Able_Service_Time();
                Set_Service_Duration(s.Get_Able_Service_Time());

              }
        }