Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            TSP tsp = new TSP();

            tsp.ParseXmlFile(@"C:\Users\Robert Szacsko\Downloads\eil51.xml\eil51.xml");

            AE(tsp);
            //WriteSolution(tsp);
        }
Ejemplo n.º 2
0
        static private void AE(TSP tsp)
        {
            Console.Write("Numarul de generatii = ");
            int NumberOfGeneration = Convert.ToInt32(Console.ReadLine());

            Console.Write("Numarul de indivizi = ");
            int NumberOfPersons = Convert.ToInt32(Console.ReadLine());

            List <List <int> > Population = Init(NumberOfPersons, tsp.NrOrase);

            int t = 0;

            while (t < NumberOfGeneration)
            {
                int punct1 = new Random().Next(0, tsp.NrOrase);
                int punct2 = new Random().Next(punct1, tsp.NrOrase);

                List <List <int> > Children = OX(Population, punct1, punct2);
                t++;
            }
        }