public PictureReproducerOrganism(PictureReproducerOrganism parrent) { Shapes = new List <SingleShape>(); Width = parrent.Width; Height = parrent.Height; ResultBitmap = new Bitmap(Width, Height); ResultBitmap.MakeTransparent(System.Drawing.Color.Transparent); randGen = parrent.randGen; }
public PictureReproducerOrganism CreateOffSpring(PictureReproducerOrganism partner) { PictureReproducerOrganism child = new PictureReproducerOrganism(this); //todo: check for constraints etc for (int i = 0; i < this.Shapes.Count / 2; i++) { child.Shapes.Add(new SingleShape(this.Shapes[i])); } for (int i = this.Shapes.Count / 2; i < this.Shapes.Count; i++) { child.Shapes.Add(new SingleShape(partner.Shapes[i])); } foreach (var s in Shapes) { s.Shape.Mutate(randGen, 0.01); } return(child); }