Ejemplo n.º 1
0
 public Gene(Gene <T> source)
 {
     this.settings  = source.settings;
     this.functions = source.functions;
     this.Allele    = new List <T>(source.Allele.Count);
     this.Allele    = functions.allelesDeepCopy(source.Allele);
     this.Fitness   = 0;
 }
Ejemplo n.º 2
0
        public Gene(int size, GenomeFunctions <T> functions, GenomeSettings settings, bool initGenes = true)
        {
            this.settings  = settings;
            this.functions = functions;
            this.Allele    = new List <T>(size);
            this.Fitness   = 0;

            if (initGenes == true)
            {
                InitGenes();
            }
        }
Ejemplo n.º 3
0
        public Genome(int genomeSize, int geneSize, GenomeFunctions <T> functions, GenomeSettings settings = null)
        {
            if (settings == null)
            {
                this.settings = new GenomeSettings(genomeSize);
            }
            else
            {
                this.settings = settings;
            }
            this.Generation = 1;
            this.Genes      = new List <Gene <T> >(genomeSize);
            this.geneSize   = geneSize;
            this.functions  = functions;

            for (int i = 0; i < Genes.Capacity; i++)
            {
                Genes.Add(new Gene <T>(geneSize, functions, settings));
            }
        }