Encog.ML.Genetic.Species.BasicSpecies.ChooseParent C# (CSharp) 메소드

ChooseParent() 공개 메소드

Choose a parent to mate. Choose from the population, determined by the survival rate. From this pool, a random parent is chosen.
public ChooseParent ( ) : IGenome
리턴 IGenome
        public IGenome ChooseParent()
        {
            IGenome baby;

            // If there is a single member, then choose that one.
            if (_members.Count == 1)
            {
                baby = _members[0];
            }
            else
            {
                // If there are many, then choose the population based on survival
                // rate
                // and select a random genome.
                int maxIndexSize = (int) (_population.SurvivalRate*_members.Count) + 1;
                var theOne = (int) RangeRandomizer.Randomize(0, maxIndexSize);
                baby = _members[theOne];
            }

            return baby;
        }