Пример #1
0
    private void BeginTestingSession(bool shouldRecord)
    {
        int set   = 0;
        int cross = 0;
        int pair  = 0;
        int pool  = 0;
        int mute  = 0;

        mute  = testingBase;
        pool  = Mathf.FloorToInt(testingBase / ((int)Testbench.MutatorLoad.TOTAL));
        pair  = Mathf.FloorToInt(pool / ((int)Testbench.MatingPoolSelectorLoad.TOTAL));
        cross = Mathf.FloorToInt(pair / ((int)Testbench.BreedingPairSelectorLoad.TOTAL));
        set   = Mathf.FloorToInt(cross / ((int)Testbench.CrossoverOperatorLoad.TOTAL));


        if (set > testingSet)
        {
            Debug.Log("Done testing set " + testingSet + " | mute: " + mute + " | pool: " + pool + " | pair: " + pair + " | cross: " + cross);
            CSVWriter.WriteOne("times", testTimes[testingSet], testSets[testingSet].ToString());
            CSVWriter.WriteOne("fitnesses", testFitnesses[testingSet], testSets[testingSet].ToString());
        }
        testingSet = set;

        if (testingSet < testSets.Length)
        {
            //Set up testing bench
            testbench.SetCrossoverOperator((Testbench.CrossoverOperatorLoad)(cross % (int)(Testbench.CrossoverOperatorLoad.TOTAL)));
            testbench.SetMatingPoolSelector((Testbench.MatingPoolSelectorLoad)(pool % (int)(Testbench.MatingPoolSelectorLoad.TOTAL)));
            testbench.SetBreedingPairSelector((Testbench.BreedingPairSelectorLoad)(pair % (int)(Testbench.BreedingPairSelectorLoad.TOTAL)));
            testbench.SetMutator((Testbench.MutatorLoad)(mute % (int)(Testbench.MutatorLoad.TOTAL)));



            ResetPopulation(true);
            StartEvolveProcess(testSets[set]);
        }
        else
        {
            EndGamut();
            // CSVWriter.WriteCSV(testTitles, testTimes[0], testTimes[1], testTimes[2], testFitnesses[0], testFitnesses[1], testFitnesses[2]);
        }
    }