/*
     * Reproduction: método que tramita la reproducción de los agentes. Si la reproducción sale bien, llamarán al método CrossOver que se
     * encargará de instanciar a los nuevos agentes.
     */
    public bool Reproduction(BaseAgent otherParent)
    {
        waitingTime = 0;
        if (otherParent.tag == "Pez")
        {
            if (gameObject.GetComponent <Fish>().juvenile || otherParent.GetComponent <Fish>().juvenile)
            {
                return(false);
            }
        }
        else if (otherParent.tag == "Rana")
        {
            if (Mathf.Pow(transform.position.x, 2) + Mathf.Pow(transform.position.y, 2) > Mathf.Pow(20.5f, 2))
            {
                return(false);
            }
        }


        float  other = otherParent.CalculateFitness();
        double av    = (CalculateFitness() + other) / 2;

        // Las posibilidades de reproduccion son mas altas conforme mayor sea el fitness de ambos
        if (Random.Range(0, 100) < av)
        {
            float offspringNumber = Random.Range(1, (dna[3] + otherParent.dna[3]) / 2);
            //Debug.Log(offspringNumber);
            for (int i = 0; i < offspringNumber; i++)
            {
                Crossover(otherParent);
            }
            timesReproduced++;
            return(true);
        }
        return(false);
    }