コード例 #1
0
        public Population(int populationSize, Boolean initialise)
        {
            tours = new Tour[populationSize];

            if (initialise)
            {
                //Loop and create random individuals
                for (int i = 0; i < populationSize; i++)
                {
                    Tour newTour = new Tour();
                    newTour.GenerateIndividual(TourManager.GetMaxFuelConsump());
                    SaveTour(i, newTour);
                }
            }
        }
コード例 #2
0
 //Saves a tour
 public void SaveTour(int index, Tour tour)
 {
     tour.SetMaxFuel(TourManager.GetMaxFuelConsump());
     tour.SetTruckLoad(TourManager.TruckLoad);
     tours[index] = tour;
 }