예제 #1
0
 private IslandGeneticAlgorithm(IslandGeneticAlgorithm original, Cloner cloner)
     : base(original, cloner)
 {
     islandQualityAnalyzer = cloner.Clone(original.islandQualityAnalyzer);
     qualityAnalyzer       = cloner.Clone(original.qualityAnalyzer);
     Initialize();
 }
 private IslandGeneticAlgorithm CreateIslandGaTspSample() {
   IslandGeneticAlgorithm ga = new IslandGeneticAlgorithm();
   #region Problem Configuration
   var provider = new TSPLIBTSPInstanceProvider();
   var instance = provider.GetDataDescriptors().Where(x => x.Name == "ch130").Single();
   TravelingSalesmanProblem tspProblem = new TravelingSalesmanProblem();
   tspProblem.Load(provider.LoadData(instance));
   tspProblem.UseDistanceMatrix.Value = true;
   #endregion
   #region Algorithm Configuration
   ga.Name = "Island Genetic Algorithm - TSP";
   ga.Description = "An island genetic algorithm which solves the \"ch130\" traveling salesman problem (imported from TSPLIB)";
   ga.Problem = tspProblem;
   SamplesUtils.ConfigureIslandGeneticAlgorithmParameters<ProportionalSelector, OrderCrossover2, InversionManipulator,
     UnidirectionalRingMigrator, BestSelector, WorstReplacer>(
     ga, 100, 1, 1000, 0.05, 5, 50, 0.25);
   #endregion
   return ga;
 }
 private IslandGeneticAlgorithm(IslandGeneticAlgorithm original, Cloner cloner)
   : base(original, cloner) {
   islandQualityAnalyzer = cloner.Clone(original.islandQualityAnalyzer);
   qualityAnalyzer = cloner.Clone(original.qualityAnalyzer);
   Initialize();
 }