void trans()
 {
     if (Form1.type_of_algorithm == 1)
     {
         schedular1 = new firstfit(holes, processes);
         schedular1.First_Fit_Algorithm();
         segments = schedular1.holes;
         ShowDialog4(schedular1.segments_not_allocated);
     }
     else if (Form1.type_of_algorithm == 2)
     {
         schedular2 = new worstfit(holes, processes);
         schedular2.computebestFit();
         segments = schedular2.holes;
         ShowDialog4(schedular2.holdProcesses);
     }
     else if (Form1.type_of_algorithm == 3)
     {
         schedular2 = new worstfit(holes, processes);
         schedular2.computeWorstFit();
         segments = schedular2.holes;
         ShowDialog4(schedular2.holdProcesses);
     }
     Draw();
 }
        public Form7()
        {
            InitializeComponent();


            num_of_process = Form1.no_of_processes;

            for (int i = 0; i < Form1.no_of_holes; i++)
            {
                hole h = new hole(Form1.holes_start_adress[i], Form1.holes_sizes[i]);
                holes.Add(h);
            }

            int idx = 0;

            for (int i = 0; i < Form1.no_of_processes; i++)
            {
                process p = new process(i + 1, Form1.no_of_segments[i]);
                for (int j = 0; j < Form1.no_of_segments[i]; j++)
                {
                    p.segmenst_sizes[j]  = Form1.size_of_segments[idx];
                    p.name_of_segment[j] = Form1.name_of_segments[idx];
                    idx++;
                }
                processes.Add(p);
            }

            colors     = new Color[15];
            colors[0]  = Color.Maroon;
            colors[1]  = Color.Yellow;
            colors[2]  = Color.Violet;
            colors[3]  = Color.Blue;
            colors[4]  = Color.Lime;
            colors[5]  = Color.Chocolate;
            colors[6]  = Color.Aqua;
            colors[7]  = Color.DarkGreen;
            colors[8]  = Color.Maroon;
            colors[9]  = Color.Pink;
            colors[10] = Color.Silver;
            colors[11] = Color.BlanchedAlmond;
            colors[12] = Color.Cyan;
            colors[13] = Color.Fuchsia;
            colors[14] = Color.Gold;
            if (Form1.type_of_algorithm == 1)
            {
                schedular1 = new firstfit(holes, processes);
                schedular1.First_Fit_Algorithm();
                segments = schedular1.holes;
                ShowDialog4(schedular1.segments_not_allocated);
            }
            else if (Form1.type_of_algorithm == 2)
            {
                schedular2 = new worstfit(holes, processes);
                schedular2.computebestFit();
                segments = schedular2.holes;
                ShowDialog4(schedular2.holdProcesses);
            }
            else if (Form1.type_of_algorithm == 3)
            {
                schedular2 = new worstfit(holes, processes);
                schedular2.computeWorstFit();
                segments = schedular2.holes;
                ShowDialog4(schedular2.holdProcesses);
            }
            Draw();
        }