Beispiel #1
0
 public void Mutate(float annealingTemperature)
 {
     leftLeg.Mutate(annealingTemperature);
     leftFoot.Mutate(annealingTemperature);
     rightLeg.Mutate(annealingTemperature);
     rightFoot.Mutate(annealingTemperature);
     leftLeg1.Mutate(annealingTemperature);
     leftFoot1.Mutate(annealingTemperature);
     rightLeg1.Mutate(annealingTemperature);
     rightFoot1.Mutate(annealingTemperature);
 }
    /// <summary>
    /// Randomly mutates one of the legs
    /// </summary>
    public Genome Mutate()
    {
        if (Random.Range(0f, 1f) > 0.5f)
        {
            left.Mutate();
        }
        else
        {
            right.Mutate();
        }

        return(this);
    }