Exemple #1
0
    public void ProcessTupleChromosome()
    {
        tIndex++;

        if (tIndex == GeneticAlgorithm.tuplePopulation.Count)
        {
            tIndex = -1;

            GeneticAlgorithm.TupleTournamentSelection();
            generation++;
            Debug.Log("New Generation");

            ProcessChromosome();
        }
        else
        {
            //Debug.Log ("tIndex: " + tIndex + " tuples count: " + GeneticAlgorithm.tuplePopulation.Count);
            currentTuple = GeneticAlgorithm.tuplePopulation [tIndex];
            if (currentTuple.GetFitness() == 0.0f || playAll)
            {
                slingshot.SetTuplesChromosome(currentTuple.chromosome);
            }
            else
            {
                EvaluateTupleChromosome(currentTuple.GetFitness(), currentTuple.solution);
            }
        }
    }