Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/06/12 01:43:06 (12 years ago)
Author:
abeham
Message:

#1782: trunk integration of problem instance development

  • Adapted TSP and QAP to use the new feature
  • Moved the TSPLIB importer dialog from the TSP plugin to the TSPLIB instances plugin (created a view for that provider)
  • Created it as a default view for IHeuristicOptimizationProblem in order not to interfere with other problems do not yet work with this
Location:
trunk/sources/HeuristicLab.Tests/HeuristicLab-3.3
Files:
2 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab-3.3/SamplesTest.cs

    r7442 r7558  
    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
     
    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
     
    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
Note: See TracChangeset for help on using the changeset viewer.