public void SetGens(FloatChromosome unit, int unitGensCount)
 {
     unit.Gens = new List <double>(unitGensCount);
     for (int ind = 0; ind < unitGensCount; ind++)
     {
         unit.Gens.Add(GetDoubleInRange());
     }
 }
        public List <FloatChromosome> Generate(FloatRange range, int populationSize, int unitGensCount)
        {
            if (populationSize < 2 || unitGensCount < 1)
            {
                throw new ArgumentException("Population must be 2 or more, gens 1 or more");
            }
            Range = range;
            List <FloatChromosome> population = new List <FloatChromosome>(populationSize);
            FloatChromosome        unit;

            for (int ind = 0; ind < populationSize; ind++)
            {
                unit = new FloatChromosome();
                SetGens(unit, unitGensCount);
                population.Add(unit);
            }
            return(population);
        }