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); } } }
//Saves a tour public void SaveTour(int index, Tour tour) { tour.SetMaxFuel(TourManager.GetMaxFuelConsump()); tour.SetTruckLoad(TourManager.TruckLoad); tours[index] = tour; }