Пример #1
0
        //  кроссенговер    VeshChrom
        private static double[] Point_CrossOver(Parametrs A, VeshChrom chromA, VeshChrom chromB)
        {
            // однототечный кроссенговер
            double[] chrom = new double[2];

            chrom[0] = A.point0 * chromA.chrom + (1 - A.point0) * chromB.chrom;

            chrom[1] = (1 - A.point0) * chromA.chrom + A.point0 * chromB.chrom;
            return(chrom);
        }
Пример #2
0
        // проверка работоспособности
        //вещественная кодировка
        private void Test_VeshCr()
        {
            VeshChrom Te1, Te2;

            Te1 = new VeshChrom(Aa, 0);
            Te2 = new VeshChrom(Aa, 1);

            MtextBox.Text = MtextBox.Text + "-------------" + Environment.NewLine +
                            Te1.Prin() + Environment.NewLine + Te2.Prin() + Environment.NewLine;
        }
Пример #3
0
 public VeshIndivid(Parametrs A)
 {
     if (A.Chom == 2)
     {
         xrom[0] = new VeshChrom(A, 0);
         xrom[1] = new VeshChrom(A, 1);
     }
     if (A.Chom == 4)
     {
         xrom[0] = new VeshChrom(A, 0);
         xrom[1] = new VeshChrom(A, 1);
         xrom[2] = new VeshChrom(A, 2);
         xrom[3] = new VeshChrom(A, 3);
     }
 }