Exemplo 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);
            }
        }
Exemplo n.º 2
0
 public int GetDistance(TSPGene a_gene)
 {
     return(TSP.GetDistance(city, a_gene.city));
 }