Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/26/12 09:51:13 (12 years ago)
Author:
jkarder
Message:

#1331: merged r8086:8330 from trunk

Location:
branches/ScatterSearch (trunk integration)
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)

  • branches/ScatterSearch (trunk integration)/HeuristicLab.Tests

  • branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab-3.3/SamplesTest.cs

    r8086 r8331  
    4444using HeuristicLab.Problems.DataAnalysis.Symbolic.Classification;
    4545using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
     46using HeuristicLab.Problems.Instances;
    4647using HeuristicLab.Problems.Instances.DataAnalysis;
    4748using HeuristicLab.Problems.Instances.TSPLIB;
     49using HeuristicLab.Problems.Instances.VehicleRouting;
    4850using HeuristicLab.Problems.Knapsack;
    4951using HeuristicLab.Problems.TestFunctions;
     
    5153using HeuristicLab.Problems.VehicleRouting;
    5254using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    53 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    5455using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;
    5556using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
    5657using HeuristicLab.Selection;
    5758using Microsoft.VisualStudio.TestTools.UnitTesting;
    58 using HeuristicLab.Problems.Instances.VehicleRouting;
    59 using HeuristicLab.Problems.Instances;
    6059
    6160
     
    133132
    134133      SolomonFormatInstanceProvider instanceProvider = new SolomonInstanceProvider();
    135       IVRPData data = instanceProvider.LoadData("C101.txt", "C101.opt.txt");
     134      IVRPData data = instanceProvider.Import("C101.txt", "C101.opt.txt");
    136135      vrpProblem.Load(data);
    137136      vrpProblem.Name = "C101 VRP (imported from Solomon)";
     
    439438    }
    440439    #endregion
     440    #region LawnMower
     441    [TestMethod]
     442    public void RunGpLawnMowerSampleTest() {
     443      var ga = CreateGpLawnMowerSample();
     444      ga.SetSeedRandomly.Value = false;
     445      RunAlgorithm(ga);
     446    }
     447
     448    public GeneticAlgorithm CreateGpLawnMowerSample() {
     449      GeneticAlgorithm ga = new GeneticAlgorithm();
     450      #region Problem Configuration
     451      var problem = new HeuristicLab.Problems.LawnMower.Problem();
     452      #endregion
     453      #region Algorithm Configuration
     454      ga.Name = "Genetic Programming - Lawn Mower";
     455      ga.Description = "A standard genetic programming algorithm to solve the lawn mower problem";
     456      ga.Problem = problem;
     457      ConfigureGeneticAlgorithmParameters<TournamentSelector, SubtreeCrossover, MultiSymbolicExpressionTreeArchitectureManipulator>(
     458        ga, 1000, 1, 50, 0.25, 5);
     459      var mutator = (MultiSymbolicExpressionTreeArchitectureManipulator)ga.Mutator;
     460      mutator.Operators.SetItemCheckedState(mutator.Operators
     461        .OfType<OnePointShaker>()
     462        .Single(), false);
     463      #endregion
     464      return ga;
     465    }
     466    #endregion
    441467    #endregion
    442468
Note: See TracChangeset for help on using the changeset viewer.