Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/12 15:47:26 (12 years ago)
Author:
spimming
Message:

#1680: merged changes from trunk into branch

Location:
branches/HeuristicLab.Hive.Azure
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure

  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Tests

  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Tests/HeuristicLab-3.3/SamplesTest.cs

    r7270 r7669  
    4444using HeuristicLab.Problems.DataAnalysis.Symbolic.Classification;
    4545using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
     46using HeuristicLab.Problems.Instances.TSPLIB;
    4647using HeuristicLab.Problems.Knapsack;
    4748using HeuristicLab.Problems.TestFunctions;
     
    5657  [TestClass]
    5758  [DeploymentItem(@"HeuristicLab-3.3/Resources/C101.opt.txt")]
    58   [DeploymentItem(@"HeuristicLab-3.3/Resources/ch130.tsp")]
    59   [DeploymentItem(@"HeuristicLab-3.3/Resources/ch130.opt.tour")]
    6059  [DeploymentItem(@"HeuristicLab-3.3/Resources/mammographic_masses.txt")]
    6160  [DeploymentItem(@"HeuristicLab-3.3/Resources/towerData.txt")]
     
    8382      GeneticAlgorithm ga = new GeneticAlgorithm();
    8483      #region Problem Configuration
     84      var provider = new TSPLIBTSPInstanceProvider();
     85      var instance = provider.GetDataDescriptors().Where(x => x.Name == "ch130").Single();
    8586      TravelingSalesmanProblem tspProblem = new TravelingSalesmanProblem();
    86       tspProblem.ImportFromTSPLIB("ch130.tsp", "ch130.opt.tour", 6110);
    87       tspProblem.EvaluatorParameter.Value = new TSPRoundedEuclideanPathEvaluator();
    88       tspProblem.SolutionCreatorParameter.Value = new RandomPermutationCreator();
     87      tspProblem.Load(provider.LoadData(instance));
    8988      tspProblem.UseDistanceMatrix.Value = true;
    90       tspProblem.Name = "ch130 TSP (imported from TSPLIB)";
    91       tspProblem.Description = "130 city problem (Churritz)";
    9289      #endregion
    9390      #region Algorithm Configuration
     
    190187      ga.SetSeedRandomly.Value = false;
    191188      RunAlgorithm(ga);
    192       Assert.AreEqual(63, GetDoubleResult(ga, "BestQuality"));
    193       Assert.AreEqual(47.26, GetDoubleResult(ga, "CurrentAverageQuality"));
     189      Assert.AreEqual(67, GetDoubleResult(ga, "BestQuality"));
     190      Assert.AreEqual(45.813, GetDoubleResult(ga, "CurrentAverageQuality"));
    194191      Assert.AreEqual(0, GetDoubleResult(ga, "CurrentWorstQuality"));
    195192      Assert.AreEqual(50950, GetIntResult(ga, "EvaluatedSolutions"));
     
    241238      ga.SetSeedRandomly.Value = false;
    242239      RunAlgorithm(ga);
    243       Assert.AreEqual(0.82932035115203739, GetDoubleResult(ga, "BestQuality"));
    244       Assert.AreEqual(0.53850226351927422, GetDoubleResult(ga, "CurrentAverageQuality"));
    245       Assert.AreEqual(0, GetDoubleResult(ga, "CurrentWorstQuality"));
     240      Assert.AreEqual(0.78855594192122458, GetDoubleResult(ga, "BestQuality"), 1E-8);
     241      Assert.AreEqual(0.61395271071681523, GetDoubleResult(ga, "CurrentAverageQuality"), 1E-8);
     242      Assert.AreEqual(0, GetDoubleResult(ga, "CurrentWorstQuality"), 1E-8);
    246243      Assert.AreEqual(50950, GetIntResult(ga, "EvaluatedSolutions"));
    247244    }
     
    344341      ga.SetSeedRandomly.Value = false;
    345342      RunAlgorithm(ga);
    346       Assert.AreEqual(0.13941049901558636, GetDoubleResult(ga, "BestQuality"));
    347       Assert.AreEqual(5.7121443289014842, GetDoubleResult(ga, "CurrentAverageQuality"));
    348       Assert.AreEqual(102.59400156249991, GetDoubleResult(ga, "CurrentWorstQuality"));
     343      Assert.AreEqual(0.13775264138895371, GetDoubleResult(ga, "BestQuality"), 1E-8);
     344      Assert.AreEqual(14.232802217120254, GetDoubleResult(ga, "CurrentAverageQuality"), 1E-8);
     345      Assert.AreEqual(104.24339008411457, GetDoubleResult(ga, "CurrentWorstQuality"), 1E-8);
    349346      Assert.AreEqual(100900, GetIntResult(ga, "EvaluatedSolutions"));
    350347    }
     
    502499      ga.SetSeedRandomly.Value = false;
    503500      RunAlgorithm(ga);
    504       Assert.AreEqual(10469, GetDoubleResult(ga, "BestQuality"));
    505       Assert.AreEqual(11184.87, GetDoubleResult(ga, "CurrentAverageQuality"));
    506       Assert.AreEqual(13420, GetDoubleResult(ga, "CurrentWorstQuality"));
     501      Assert.AreEqual(9918, GetDoubleResult(ga, "BestQuality"));
     502      Assert.AreEqual(10324.64, GetDoubleResult(ga, "CurrentAverageQuality"));
     503      Assert.AreEqual(11823, GetDoubleResult(ga, "CurrentWorstQuality"));
    507504      Assert.AreEqual(495500, GetIntResult(ga, "EvaluatedSolutions"));
    508505    }
     
    511508      IslandGeneticAlgorithm ga = new IslandGeneticAlgorithm();
    512509      #region Problem Configuration
     510      var provider = new TSPLIBTSPInstanceProvider();
     511      var instance = provider.GetDataDescriptors().Where(x => x.Name == "ch130").Single();
    513512      TravelingSalesmanProblem tspProblem = new TravelingSalesmanProblem();
    514       tspProblem.ImportFromTSPLIB("ch130.tsp", "ch130.opt.tour", 6110);
    515       tspProblem.EvaluatorParameter.Value = new TSPRoundedEuclideanPathEvaluator();
    516       tspProblem.SolutionCreatorParameter.Value = new RandomPermutationCreator();
     513      tspProblem.Load(provider.LoadData(instance));
    517514      tspProblem.UseDistanceMatrix.Value = true;
    518       tspProblem.Name = "ch130 TSP (imported from TSPLIB)";
    519       tspProblem.Description = "130 city problem (Churritz)";
    520515      #endregion
    521516      #region Algorithm Configuration
     
    561556      #region Problem Configuration
    562557      KnapsackProblem problem = new KnapsackProblem();
    563       problem.BestKnownQuality.Value = 362;
     558      problem.BestKnownQuality = new DoubleValue(362);
    564559      problem.BestKnownSolution = new HeuristicLab.Encodings.BinaryVectorEncoding.BinaryVector(new bool[] {
    565560       true , false, false, true , true , true , true , true , false, true , true , true , true , true , true , false, true , false, true , true , false, true , true , false, true , false, true , true , true , false, true , true , false, true , true , false, true , false, true , true , true , true , true , true , true , true , true , true , true , true , true , false, true , false, false, true , true , false, true , true , true , true , true , true , true , true , false, true , false, true , true , true , true , false, true , true , true , true , true , true , true , true});
     
    766761      TabuSearch ts = new TabuSearch();
    767762      #region Problem Configuration
    768       var tspProblem = new TravelingSalesmanProblem();
    769       tspProblem.ImportFromTSPLIB("ch130.tsp", "ch130.opt.tour", 6110);
    770       tspProblem.EvaluatorParameter.Value = new TSPRoundedEuclideanPathEvaluator();
    771       tspProblem.SolutionCreatorParameter.Value = new RandomPermutationCreator();
     763      var provider = new TSPLIBTSPInstanceProvider();
     764      var instance = provider.GetDataDescriptors().Where(x => x.Name == "ch130").Single();
     765      TravelingSalesmanProblem tspProblem = new TravelingSalesmanProblem();
     766      tspProblem.Load(provider.LoadData(instance));
    772767      tspProblem.UseDistanceMatrix.Value = true;
    773       tspProblem.Name = "ch130 TSP (imported from TSPLIB)";
    774       tspProblem.Description = "130 city problem (Churritz)";
    775768      #endregion
    776769      #region Algorithm Configuration
     
    850843{48, 71}, {49, 71}, {50, 71}, {44, 70}, {45, 70}, {52, 70}, {53, 70}, {54, 70}, {41, 69}, {42, 69}, {55, 69}, {56, 69}, {40, 68}, {56, 68}, {57, 68}, {39, 67}, {57, 67}, {58, 67}, {59, 67}, {38, 66}, {59, 66}, {60, 66}, {37, 65}, {60, 65}, {36, 64}, {43, 64}, {35, 63}, {37, 63}, {41, 63}, {42, 63}, {43, 63}, {47, 63}, {61, 63}, {40, 62}, {41, 62}, {42, 62}, {43, 62}, {45, 62}, {46, 62}, {47, 62}, {62, 62}, {34, 61}, {38, 61}, {39, 61}, {42, 61}, {43, 61}, {44, 61}, {45, 61}, {46, 61}, {47, 61}, {52, 61}, {62, 61}, {63, 61}, {26, 60}, {38, 60}, {42, 60}, {43, 60}, {44, 60}, {46, 60}, {47, 60}, {63, 60}, {23, 59}, {24, 59}, {27, 59}, {29, 59}, {30, 59}, {31, 59}, {33, 59}, {42, 59}, {46, 59}, {47, 59}, {63, 59}, {21, 58}, {32, 58}, {33, 58}, {34, 58}, {35, 58}, {46, 58}, {47, 58}, {48, 58}, {53, 58}, {21, 57}, {35, 57}, {47, 57}, {48, 57}, {53, 57}, {36, 56}, {37, 56}, {46, 56}, {47, 56}, {48, 56}, {64, 56}, {65, 56}, {20, 55}, {38, 55}, {46, 55}, {47, 55}, {48, 55}, {52, 55}, {21, 54}, {40, 54}, {47, 54}, {48, 54}, {52, 54}, {65, 54}, {30, 53}, {41, 53}, {46, 53}, {47, 53}, {48, 53}, {52, 53}, {65, 53}, {21, 52}, {32, 52}, {33, 52}, {42, 52}, {51, 52}, {21, 51}, {33, 51}, {34, 51}, {43, 51}, {51, 51}, {21, 50}, {35, 50}, {44, 50}, {50, 50}, {66, 50}, {67, 50}, {21, 49}, {34, 49}, {36, 49}, {37, 49}, {46, 49}, {49, 49}, {67, 49}, {22, 48}, {36, 48}, {37, 48}, {46, 48}, {47, 48}, {22, 47}, {30, 47}, {34, 47}, {37, 47}, {38, 47}, {39, 47}, {47, 47}, {48, 47}, {67, 47}, {23, 46}, {28, 46}, {29, 46}, {30, 46}, {31, 46}, {32, 46}, {35, 46}, {37, 46}, {38, 46}, {39, 46}, {49, 46}, {67, 46}, {23, 45}, {28, 45}, {29, 45}, {31, 45}, {32, 45}, {40, 45}, {41, 45}, {49, 45}, {50, 45}, {68, 45}, {24, 44}, {29, 44}, {32, 44}, {41, 44}, {51, 44}, {68, 44}, {25, 43}, {30, 43}, {32, 43}, {42, 43}, {43, 43}, {51, 43}, {68, 43}, {69, 43}, {31, 42}, {32, 42}, {43, 42}, {52, 42}, {55, 42}, {26, 41}, {27, 41}, {31, 41}, {32, 41}, {33, 41}, {44, 41}, {45, 41}, {46, 41}, {47, 41}, {48, 41}, {49, 41}, {53, 41}, {25, 40}, {27, 40}, {32, 40}, {43, 40}, {44, 40}, {45, 40}, {46, 40}, {48, 40}, {49, 40}, {50, 40}, {51, 40}, {53, 40}, {56, 40}, {32, 39}, {33, 39}, {43, 39}, {50, 39}, {51, 39}, {54, 39}, {56, 39}, {69, 39}, {24, 38}, {32, 38}, {41, 38}, {42, 38}, {51, 38}, {52, 38}, {54, 38}, {57, 38}, {69, 38}, {31, 37}, {32, 37}, {40, 37}, {41, 37}, {42, 37}, {43, 37}, {44, 37}, {45, 37}, {46, 37}, {47, 37}, {48, 37}, {51, 37}, {52, 37}, {55, 37}, {57, 37}, {69, 37}, {24, 36}, {31, 36}, {32, 36}, {39, 36}, {40, 36}, {41, 36}, {42, 36}, {43, 36}, {45, 36}, {48, 36}, {49, 36}, {51, 36}, {53, 36}, {55, 36}, {58, 36}, {22, 35}, {23, 35}, {24, 35}, {25, 35}, {30, 35}, {31, 35}, {32, 35}, {39, 35}, {41, 35}, {49, 35}, {51, 35}, {55, 35}, {56, 35}, {58, 35}, {71, 35}, {20, 34}, {27, 34}, {30, 34}, {31, 34}, {51, 34}, {53, 34}, {57, 34}, {60, 34}, {18, 33}, {19, 33}, {29, 33}, {30, 33}, {31, 33}, {45, 33}, {46, 33}, {47, 33}, {52, 33}, {53, 33}, {55, 33}, {57, 33}, {58, 33}, {17, 32}, {30, 32}, {44, 32}, {47, 32}, {54, 32}, {57, 32}, {59, 32}, {61, 32}, {71, 32}, {72, 32}, {43, 31}, {47, 31}, {56, 31}, {58, 31}, {59, 31}, {61, 31}, {72, 31}, {74, 31}, {16, 30}, {43, 30}, {46, 30}, {47, 30}, {59, 30}, {63, 30}, {71, 30}, {75, 30}, {43, 29}, {46, 29}, {47, 29}, {59, 29}, {60, 29}, {75, 29}, {15, 28}, {43, 28}, {46, 28}, {61, 28}, {76, 28}, {15, 27}, {43, 27}, {44, 27}, {45, 27}, {46, 27}, {60, 27}, {62, 27}, {15, 26}, {43, 26}, {44, 26}, {46, 26}, {59, 26}, {60, 26}, {64, 26}, {77, 26}, {15, 25}, {58, 25}, {61, 25}, {77, 25}, {15, 24}, {53, 24}, {55, 24}, {61, 24}, {77, 24}, {62, 23}, {16, 22}, {61, 22}, {62, 22}, {15, 21}, {16, 21}, {52, 21}, {63, 21}, {77, 21}, {16, 20}, {17, 20}, {46, 20}, {47, 20}, {60, 20}, {62, 20}, {63, 20}, {65, 20}, {76, 20}, {15, 19}, {17, 19}, {18, 19}, {44, 19}, {45, 19}, {48, 19}, {53, 19}, {56, 19}, {60, 19}, {62, 19}, {67, 19}, {68, 19}, {76, 19}, {15, 18}, {18, 18}, {19, 18}, {20, 18}, {32, 18}, {33, 18}, {34, 18}, {41, 18}, {42, 18}, {43, 18}, {46, 18}, {48, 18}, {53, 18}, {59, 18}, {60, 18}, {69, 18}, {75, 18}, {16, 17}, {17, 17}, {20, 17}, {21, 17}, {22, 17}, {23, 17}, {24, 17}, {26, 17}, {28, 17}, {29, 17}, {30, 17}, {31, 17}, {32, 17}, {34, 17}, {35, 17}, {36, 17}, {37, 17}, {38, 17}, {39, 17}, {40, 17}, {44, 17}, {46, 17}, {48, 17}, {53, 17}, {56, 17}, {58, 17}, {75, 17}, {17, 16}, {18, 16}, {20, 16}, {24, 16}, {26, 16}, {27, 16}, {29, 16}, {33, 16}, {41, 16}, {42, 16}, {44, 16}, {47, 16}, {52, 16}, {57, 16}, {70, 16}, {73, 16}, {74, 16}, {17, 15}, {18, 15}, {20, 15}, {22, 15}, {24, 15}, {27, 15}, {29, 15}, {31, 15}, {33, 15}, {35, 15}, {36, 15}, {38, 15}, {39, 15}, {42, 15}, {45, 15}, {47, 15}, {52, 15}, {53, 15}, {55, 15}, {56, 15}, {70, 15}, {73, 15}, {17, 14}, {19, 14}, {21, 14}, {24, 14}, {26, 14}, {29, 14}, {31, 14}, {34, 14}, {37, 14}, {40, 14}, {42, 14}, {44, 14}, {46, 14}, {47, 14}, {53, 14}, {54, 14}, {55, 14}, {62, 14}, {70, 14}, {72, 14}, {17, 13}, {19, 13}, {21, 13}, {23, 13}, {25, 13}, {27, 13}, {30, 13}, {32, 13}, {34, 13}, {36, 13}, {38, 13}, {41, 13}, {43, 13}, {44, 13}, {45, 13}, {60, 13}, {70, 13}, {71, 13}, {18, 12}, {21, 12}, {23, 12}, {26, 12}, {28, 12}, {31, 12}, {34, 12}, {37, 12}, {39, 12}, {41, 12}, {42, 12}, {70, 12}, {18, 11}, {19, 11}, {20, 11}, {21, 11}, {24, 11}, {25, 11}, {27, 11}, {29, 11}, {31, 11}, {33, 11}, {35, 11}, {38, 11}, {41, 11}, {59, 11}, {26, 10}, {29, 10}, {32, 10}, {34, 10}, {36, 10}, {39, 10}, {40, 10}, {69, 10}, {21, 9}, {26, 9}, {28, 9}, {30, 9}, {32, 9}, {33, 9}, {35, 9}, {36, 9}, {37, 9}, {38, 9}, {39, 9}, {22, 8}, {27, 8}, {28, 8}, {29, 8}, {30, 8}, {31, 8}, {68, 8}, {23, 7}, {66, 7}, {24, 6}, {65, 6}, {25, 5}, {62, 5}, {63, 5}, {26, 4}, {55, 4}, {56, 4}, {57, 4}, {58, 4}, {59, 4}, {60, 4}, {61, 4}, {28, 3}, {53, 3}, {29, 2}, {50, 2}, {51, 2}, {52, 2}, {31, 1}, {32, 1}, {48, 1}
    851844      });
    852       tspProblem.BestKnownQuality.Value = 867;
     845      tspProblem.BestKnownQuality = new DoubleValue(867);
    853846
    854847      tspProblem.EvaluatorParameter.Value = new TSPRoundedEuclideanPathEvaluator();
Note: See TracChangeset for help on using the changeset viewer.