コード例 #1
0
        public void Algoritm_1()
        {
            int buff, buff2;

            for (int i = 0; i < groups.Nz1.Count; i++)
            {
                for (int j = 0; j < groups.Nz1[i].Count; j++)
                {
                    for (int k = 0; k < groups.Nz1[i][j].Count; k++)
                    {
                        for (int l = 0; l < Q.Nz1[0].Count; l++)
                        {
                            for (int t = 0; t < Q.Nz1[0][l].Count; t++)
                            {
                                this.shedule = new Shedule(this.BuildR(groups.Nz1[i]), countL);
                                this.shedule.ConstructShedule();
                                buff2 = shedule.GetTime();
                                buff  = groups.Nz1[i][j][k];
                                groups.Nz1[i][l][k] = Q.Nz1[0][l][t];
                                this.shedule        = new Shedule(this.BuildR(groups.Nz1[i]), countL);
                                this.shedule.ConstructShedule();
                                if (shedule.GetTime() > buff2)
                                {
                                    groups.Nz1[i][j][k] = buff;
                                }
                            }
                        }
                    }
                }
            }
            Algoritm_3();
        }
コード例 #2
0
        public void Algoritm_3()
        {
            int buff = 0;

            for (int k = 0; k < groups.Nz1.Count(); k++)
            {
                for (int i = 0; i < Q.Nz1[0].Count(); i++)
                {
                    for (int j = 0; j < Q.Nz1[0][i].Count(); j++)
                    {
                        groups.Nz1[k][i].Add(Q.Nz1[0][i][j]);

                        this.shedule = new Shedule(this.BuildR(groups.Nz1[k]), countL);
                        this.shedule.ConstructShedule();
                        if (shedule.GetTime() > Tz)
                        {
                            groups.Nz1[k][i].RemoveAt(groups.Nz1[k][i].Count - 1);
                        }
                        else
                        {
                            Q.Nz1[0][i].RemoveAt(j);
                        }
                    }
                }
            }
            for (int k = 0; k < groups.Nz1.Count(); k++)
            {
                this.shedule = new Shedule(this.BuildR(groups.Nz1[k]), countL);
                this.shedule.ConstructShedule();

                Prostoi[k] = Tz - shedule.GetTime();

                //MessageBox.Show(Convert.ToString(Tz - shedule.GetTime()));
            }
        }
コード例 #3
0
ファイル: SecondLevel.cs プロジェクト: sasha2567/diplom
        public void Algoritm_3()
        {
            for (int k = 0; k < groups.Nz1.Count(); k++)
            {
                for (int i = 0; i < Q.Nz1[0].Count(); i++)
                {
                    for (int j = 0; j < Q.Nz1[0][i].Count(); j++)
                    {
                        groups.Nz1[k][i].Add(Q.Nz1[0][i][j]);

                        this.shedule = new Shedule(this.BuildR(groups.Nz1[k]), countL);
                        this.shedule.ConstructShedule();
                        if (shedule.GetTime() > Tz)
                        {
                            groups.Nz1[k][i].Remove(Q.Nz1[0][i][j]);
                        }
                        else
                        {
                            Q.Nz1[0][i].Remove(Q.Nz1[0][i][j]);
                        }
                    }
                }
            }
        }
コード例 #4
0
ファイル: SecondLevel.cs プロジェクト: sasha2567/diplom
        public List <List <List <int> > > Algoritm_2()
        {
            int logi = 0;//номер группы текущий расматриваемый

            //A.Clear();

            /*for (int i = 0; i < 4; i++)
             * {
             *  List<int> w = new List<int>();
             *  A.Add(w);
             * }*/

            //A[0].Add(12); A[0].Add(2); A[0].Add(2);
            //A[1].Add(13); A[1].Add(3);
            //A[2].Add(10); A[2].Add(2); A[2].Add(2); A[2].Add(2);
            //A[3].Add(8); A[3].Add(2); A[3].Add(2); A[3].Add(2); A[3].Add(2);

            if (this.A[0].Count == 0)
            {
                A.RemoveAt(0);
                for (int i = 0; i < A.Count(); i++)
                {
                    A[i].RemoveAt(0);
                }
            }

            for (int i = 0; i < 4; i++)
            {
                groups.Nz1.Add(new List <List <int> >());
            }

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    groups.Nz1[i].Add(new List <int>());
                }
            }


            Q.Nz1.Add(new List <List <int> >());
            for (int i = 0; i < 4; i++)
            {
                Q.Nz1[0].Add(new List <int>());
            }

            for (int i = 0; i < A.Count(); i++)
            {
                for (int j = 0; j < A[i].Count(); j++)
                {
                    if (logi >= 4)
                    {
                        Q.Nz1[0][i].Add(A[i][j]);
                    }
                    else
                    {
                        groups.Nz1[logi][i].Add(A[i][j]);
                        this.shedule = new Shedule(this.BuildR(groups.Nz1[logi]), countL);
                        this.shedule.ConstructShedule();

                        if (this.shedule.GetTime() > Tz)
                        {
                            groups.Nz1[logi][i].Remove(A[i][j]);
                            j--;
                            logi++;
                        }
                    }
                }
            }

            if ((Q.Nz1[0].Count() > 0) && (c))
            {
                Algoritm_3();
            }

            return(groups.Nz1);//изменить
        }