Esempio n. 1
0
        public TSPIndividual()
        {
            Genome = new List <Interfaces.IGene>();
            List <City> cities = TSP.GetCities();

            while (cities.Count != 0)
            {
                int index = Parameters.RandomGenerator.Next(cities.Count);
                Genome.Add(new TSPGene(cities.ElementAt(index)));
                cities.RemoveAt(index);
            }
        }
Esempio n. 2
0
 public int GetDistance(TSPGene a_gene)
 {
     return(TSP.GetDistance(city, a_gene.city));
 }