Beispiel #1
0
        // Gets the best tour in the population
        public Knapsack getFittest()
        {
            Knapsack fittest = sacs[0];

            for (int i = 1; i < populationSize(); i++)
            {
                if (fittest.getFitness() <= getSac(i).getFitness())
                {
                    fittest = getSac(i);
                }
            }

            return(fittest);
        }