Пример #1
0
        private float[] Mutated(float[] chromosome)
        {
            bool shouldMutate = UnityEngine.Random.Range(0, 100.0f) < Settings.MutationRate * 100f;

            if (!shouldMutate)
            {
                return(chromosome);
            }

            return(Mutation.Mutate(chromosome, Settings.MutationAlgorithm));
        }
Пример #2
0
 public static float[] Mutate(float[] chromosome, MutationAlgorithm mode)
 {
     return(Mutation.Mutate <MutatableFloatArray, float>(new MutatableFloatArray(chromosome), mode, Mutate).Values);
 }
Пример #3
0
 public static StringBuilder Mutate(StringBuilder builder, MutationAlgorithm mode)
 {
     return(Mutation.Mutate <MutatableString, char>(new MutatableString(builder), mode, Mutate).Builder);
 }