Exemple #1
0
    public void NextGeneration(string userSelection = "")
    {
        //should i save each generation in the population object

        //targetstring is blank (if selection type is user, don't need a target eh?
        //make genome more generic, and specifiable

        //currently the targetstring is defining the length of the seeded genomes. That's not ideal.

        //I should specify the seeding information in the encoder....

        //how do I deal with variable length genomes???? This matters in crossover, fitness, and seeding the population
        //for the next step only need to focus on crossover and seeding.

        //need to be able to seed a population from a list of values

        //stop using all the letters a - z?

        if (!(_selection._selectionType == "god mode"))
        {
            _fitness.Apply(Population);
        }

        List <Genome> parentSelection = _selection.Select(Population, userSelection);

        _crossover.Apply(Population, parentSelection);
        _mutation.Apply(Population);
        Population._generation++;

        Debug.Log(this.ToString());
    }
Exemple #2
0
    public void NextGeneration()
    {
        var popOrderedByFitness = _fitness.Apply(Population);
        var parentSelection     = _selection.Select(Population);
        var childrenCrossed     = _crossover.Apply(popOrderedByFitness, parentSelection);
        var childrenMutated     = _mutation.Apply(childrenCrossed);

        Population = childrenMutated;

        Population._generation++;
    }
Exemple #3
0
    public void NextGeneration(string userSelection = "")
    {
        //only apply the fitness class if selection type is fitness based
        if (!(_selection._selectionType == "god mode"))
        {
            _fitness.Apply(Population);
        }

        List <Genome> parentSelection = _selection.Select(Population, userSelection); //applies the selection algorithm chosen to the population

        _crossover.Apply(Population, parentSelection);
        _mutation.Apply(Population);
        Population._generation++;

        Debug.Log(this);
    }