示例#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));
     }
 }
示例#2
0
文件: Genome.cs 项目: NVSarge/TF
        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);
        }