public static int[] GenerationDifference(GenIDXXX id1, GenIDXXX id2) { var lim = Math.Min(id1._ID.Length, id2._ID.Length); for (int i = 0; i < lim; i++) { if (id1._ID[i] != id2._ID[i]) { return new int[2] { id1._ID.Length - i, id2._ID.Length - i }; } } throw new NotImplementedException(); }
public GenIDXXX(GenIDXXX parent) { var idl = parent._ID.ToList<int>(); idl.Add(parent._offspringCount); this._ID = idl.ToArray<int>(); parent._offspringCount++; }