public Population(SKBitmap targetBitmap, Engine.RunConfig runConfig) { this.targetBitmap = targetBitmap; this.numberOfGenes = runConfig.GenesPerGeneration; this.numberOfGenesToReproduce = runConfig.GenesToReproduce; Utilities.SaveBitmap(this.targetBitmap, $"{Utilities.EngineOutputDirectory}/target.png"); }
public void GenerateLineGenePopulation(Engine.RunConfig runConfig) { for (int i = 0; i < this.numberOfGenes; i++) { Gene gene = new LineGene(this.targetBitmap.Width, this.targetBitmap.Height, runConfig.MutationRangeMax, runConfig.NumberOfSteps); gene.InitRandomly(); this.genes.Add(gene); } }