Пример #1
0
    // Use this for initialization
    void Start()
    {
        GetSettings();

        lastGenBest = -1;
        startArea   = GameObject.FindWithTag("StartArea");
        //panel that shows statistics about winning
        wonPanel = GameObject.Find("WonPanel");
        wonPanel.SetActive(false);

        spawnPos     = startArea.transform.position;
        spawnPos.z   = spawnPos.z - 0.1f; //just to put it above level so the picture shows up
        currMaxSteps = beginSteps;


        //used for saving in file
        //delete old file
        SaveScores.deleteCSV();
        lastBestFitness    = new float[10];
        lastAverageFitness = new float[10];
        lastGens           = new int[10];

        InitializeGoalMarkers();
        //spawn first squares
        SpawnFirstGeneration();
    }
Пример #2
0
    /// <summary>
    /// Reset evolution parameters. Called by ResetEvolution
    /// </summary>
    void ResetParameters()
    {
        lastGenBest   = -1;
        levelComplete = false;
        currMaxSteps  = beginSteps;
        currGen       = 1;


        //used for saving in file
        //delete old file
        SaveScores.deleteCSV();
        lastBestFitness    = new float[10];
        lastAverageFitness = new float[10];
        lastGens           = new int[10];

        //spawn first squares
        SpawnFirstGeneration();
    }