Beispiel #1
0
 public Population(int size, int genomeLength)
 {
     FullLength = size;
     Rating     = new List <double[]>();
     Pop        = new List <Genome <T> >();
     GP         = new GenePool <T>();
     for (int i = 0; i < size; i++)
     {
         Pop.Add(new Genome <T>(genomeLength));
     }
 }
Beispiel #2
0
        public T[] RandomizeInitial(GenePool <T> GP, Random r = null)
        {
            if (r == null)
            {
                r = new Random();
            }

            for (int i = 0; i < Genom.Length; i++)
            {
                Genom[i] = GP.GetRandomGene(r);
            }
            return(Genom);
        }