Exemple #1
0
        /// <inheritdoc />
        public IGenome MutateGenome(IGenome genome)
        {
            if (null == genome)
            {
                throw new ArgumentNullException(nameof(genome));
            }

            var clone = genome.Clone();

            for (var count = 0; count < mutationsCount; count++)
            {
                var index = random.Next(clone.Length);
                clone.Replace(index, opCodeGenerator.NextOpCode());
            }

            return(clone);
        }