Пример #1
0
    void Awake()
    {
        anim        = GetComponent <Animator>();
        playerAudio = GetComponent <AudioSource>();

        playerMovement = GetComponent <PlayerMovement> ();
        //playerShooting = GetComponentInChildren <PlayerShooting> ();
        currentHealth = startingHealth;
        if (isEvolutivo)
        {
            Evolutivo = GameObject.FindGameObjectWithTag("Evolutivo").GetComponent <AlgoritmoEvolutivo>();
        }
    }
Пример #2
0
    // Use this for initialization
    private void Awake()
    {
        // tiempoPruebaOriginal = tiempoPruebaOriginal;
        if (algoritmoEvolutivo == null)
        {
            algoritmoEvolutivo = this;
            DontDestroyOnLoad(gameObject);
            MaxFitness = 1.2f * ((tiempoPruebaOriginal / 0.2f) - (tiempoPruebaOriginal / 15f)) * 1 + ((tiempoPruebaOriginal / 15f) * puntosPorCuracion);
            if (poblacion == null)
            {
                poblacion  = new List <GenomaNEAT>();
                matingPool = new List <float[]>();
                especies   = new List <List <GenomaNEAT> >();
                fitness    = new float[tamanioPoblacion];
                resultados = new float[tamanioPoblacion, 5];

                crearPoblacion();


                float aux = tasaMutacion;

                tasaMutacion = 1.0f;
                foreach (List <GenomaNEAT> especie in especies)
                {
                    foreach (GenomaNEAT individuo in especie)
                    {
                        for (int i = 0; i < 10; i++)
                        {
                            mutacion(individuo);
                        }
                        //Debug.Log("cambie un gen");
                    }
                }
                tasaMutacion = aux;
            }
        }
        else if (algoritmoEvolutivo != this)
        {
            Destroy(gameObject);
        }
    }
Пример #3
0
 private void Start()
 {
     evolutivo = GameObject.FindGameObjectWithTag("Evolutivo").GetComponent <AlgoritmoEvolutivo>();
 }
Пример #4
0
 void Start()
 {
     companion    = BusquedaHijos.buscarHijoPorTag(gameObject, "Companion").GetComponent <CompanionEvolutivo>();
     saludJugador = BusquedaHijos.buscarHijoPorTag(gameObject, "Player").GetComponent <PlayerHealth>();
     evolutivo    = GameObject.FindGameObjectWithTag("Evolutivo").GetComponent <AlgoritmoEvolutivo>();
 }
Пример #5
0
    //Metodos
    private void Start()
    {
        evolutivo = GameObject.FindGameObjectWithTag("Evolutivo").GetComponent <AlgoritmoEvolutivo>();

        //Invoke("Jugar", 0.2f);
    }