Example #1
0
        public List <Canli> PopulasyonOlustur(int pop)
        {
            List <Canli> liste = new Canli().Olustur(pop);

            canliList = liste;
            return(liste);
        }
Example #2
0
        private Canli Kiyasla(Canli c1, Canli c2)
        {
            Canli c = new Canli();

            c = c1.Gen.SphereFormul > c2.Gen.SphereFormul ? c2 : c1;
            return(c);
        }
 public GenTablo(Canli c, int no) : this()
 {
     this.Canli  = c;
     label5.Text = no.ToString();
     label8.Text = c.Gen.x1.ToString();
     label9.Text = c.Gen.x2.ToString();
     label3.Text = c.Gen.SphereFormul.ToString();
 }
Example #4
0
        public bool ElitizmFlowLayoutEkle(Canli c)
        {
            foreach (var elitizm in flowLayoutPanel1.Controls.OfType <GenTablo>())
            {
                if (c.Gen.SphereFormul == elitizm.Canli.Gen.SphereFormul)
                {
                    return(false);
                }
            }

            label11.Text = "Toplam Gen Sayısı:" + (flowLayoutPanel1.Controls.Count + 1);
            var comp = new GenTablo(c, flowLayoutPanel1.Controls.Count + 1);

            comp.Click += (s, arg) =>
            {
                var canli = ((s as Control).Parent.Parent.Parent as GenTablo).Canli;
                var list  = new List <Canli>();
                list.Add(canli);
            };
            flowLayoutPanel1.Controls.Add(comp);
            return(true);
        }