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); }
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; }