Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 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);
     }
 }