Esempio n. 1
0
        public static DNA CrossOver(DNA a, DNA b)
        {
            DNA parent = new DNA(1);

            parent.Cut(0);

            for (int i = 0; i < a.FullSequence.Count; i++)
            {
                DNA _combined = DNA.Combine(a.FullSequence[i], b.FullSequence[i]);
                parent.Add(_combined);
            }


            return(parent);
        }
Esempio n. 2
0
        public void Mesh()
        {
            for (int i = 0; i < Layers.Count - 1; i++)
            {
                Layer CURRENT = Layers[i];
                Layer NEXT    = Layers[i + 1];

                NEXT.PreviousLayer = CURRENT;
                CURRENT.NextLayer  = NEXT;

                CURRENT.MeshWithNextLayer();
                DNA.Add(CURRENT.DNA);
            }

            DNA.Add(Layers[Layers.Count - 1].DNA);

            IsMeshed = true;
        }