void InitializeValues() { totalCities = SharedMethods.TotalCities; tourOrder = new int[totalCities]; tourLocations = new Vector2[totalCities]; (tourLocations, tourOrder) = SharedMethods.InitializeLocations(totalCities, random); SharedMethods.Order.CopyTo(tourOrder, 0); SharedMethods.Locations.CopyTo(tourLocations, 0); SharedMethods.DrawPoints(pointsGrid); initialDistance = SharedMethods.RoundTripDistance(tourLocations, tourOrder); populationSize = SharedMethods.PopulationSize; mutationRate = SharedMethods.MutationRate; elitism = SharedMethods.Elitism; count = 0; ga = null; ga = new GAClass(populationSize, totalCities, elitism, random, mutationRate); }
void InitializeValues() { totalCities = SharedMethods.TotalCities; tourOrder = new int[totalCities]; tourLocations = new Vector2[totalCities]; bestTourOrder = new int[totalCities]; (tourLocations, tourOrder) = SharedMethods.InitializeLocations(totalCities, random); SharedMethods.Order.CopyTo(tourOrder, 0); SharedMethods.Locations.CopyTo(tourLocations, 0); SharedMethods.DrawPoints(pointsGrid); initialDistance = SharedMethods.RoundTripDistance(tourLocations, tourOrder); bestTourDistance = float.PositiveInfinity; swaps = 0; }
void InitializeValues() { totalCities = SharedMethods.TotalCities; tourOrder = new int[totalCities]; tourLocations = new Vector2[totalCities]; bestTourOrder = new int[totalCities]; (tourLocations, tourOrder) = SharedMethods.InitializeLocations(totalCities, random); SharedMethods.Order.CopyTo(tourOrder, 0); SharedMethods.Locations.CopyTo(tourLocations, 0); SharedMethods.DrawPoints(pointsGrid); initialDistance = SharedMethods.RoundTripDistance(tourLocations, tourOrder); totalIterations = SharedMethods.Factorial(totalCities); currentIteration = 0; bestTourDistance = double.PositiveInfinity; }
void InitializeValues() { totalCities = SharedMethods.TotalCities; tourOrder = new int[totalCities]; tourLocations = new Vector2[totalCities]; (tourLocations, tourOrder) = SharedMethods.InitializeLocations(totalCities, random); SharedMethods.Order.CopyTo(tourOrder, 0); SharedMethods.Locations.CopyTo(tourLocations, 0); SharedMethods.DrawPoints(pointsGrid); initialDistance = SharedMethods.RoundTripDistance(tourLocations, tourOrder); Temperature = SharedMethods.Temperature; TemperatureRate = SharedMethods.TemperatureRate; count = 0; }