Exemple #1
0
    void Awake()
    {
        instance   = this;
        generation = 1;
        timer      = 0.0f;

        landerPos = new Vector3(Random.Range(-16, 17), 0, Random.Range(10, 16));
        for (int i = 0; i < lunarsNum; i++)
        {
            GameObject obj = Instantiate(landerPrefab, landerPos, Quaternion.Euler(90, 0, 0));
            Lander     lan = obj.GetComponent <Lander>();
            lan.SetBrain(inputs, outputs, numHiddenLayers, numNeuronPerHiddenLayer, bias, sigmoidPending);
            lan.SetLimits(maxHeight, maxWidth);
            if (i == 0)
            {
                ga = new GeneticAlg(elitesNum, lunarsNum, lan.GetNumberOfWeights(), mutation);
            }
            landers.Add(lan);
        }
        plataform = Instantiate(plataformPrefab, new Vector3(Random.Range(-17, 18), 0, Random.Range(-15, -9)), Quaternion.Euler(90, 0, 0));
    }