Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8780 for trunk/sources


Ignore:
Timestamp:
10/10/12 14:31:22 (12 years ago)
Author:
ascheibe
Message:

#1329 added RAPGA JSSP sample

Location:
trunk/sources
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj

    r8775 r8780  
    126126    <EmbeddedResource Include="Documents\TS_VRP.hl" />
    127127    <EmbeddedResource Include="Documents\SS_VRP.hl" />
     128    <EmbeddedResource Include="Documents\RAPGA_JSSP.hl" />
    128129    <None Include="Plugin.cs.frame" />
    129130    <Compile Include="DefineArithmeticProgressionDialog.cs">
  • trunk/sources/HeuristicLab.Tests/HeuristicLab-3.3/SamplesTest.cs

    r8775 r8780  
    2828using HeuristicLab.Algorithms.LocalSearch;
    2929using HeuristicLab.Algorithms.ParticleSwarmOptimization;
     30using HeuristicLab.Algorithms.RAPGA;
    3031using HeuristicLab.Algorithms.ScatterSearch;
    3132using HeuristicLab.Algorithms.SimulatedAnnealing;
     
    3637using HeuristicLab.Encodings.PermutationEncoding;
    3738using HeuristicLab.Encodings.RealVectorEncoding;
     39using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix;
    3840using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    3941using HeuristicLab.Optimization;
     
    5153using HeuristicLab.Problems.Instances.VehicleRouting;
    5254using HeuristicLab.Problems.Knapsack;
     55using HeuristicLab.Problems.Scheduling;
    5356using HeuristicLab.Problems.TestFunctions;
    5457using HeuristicLab.Problems.TravelingSalesman;
     
    10061009    #endregion
    10071010
     1011    #region RAPGA
     1012    #region Scheduling
     1013    [TestMethod]
     1014    public void CreateRAPGASchedulingSampleTest() {
     1015      var ss = CreateRAPGASchedulingSample();
     1016      XmlGenerator.Serialize(ss, "../../RAPGA_JSSP.hl");
     1017    }
     1018
     1019    [TestMethod]
     1020    public void RunRAPGASchedulingSampleTest() {
     1021      var rapga = CreateRAPGASchedulingSample();
     1022      rapga.SetSeedRandomly.Value = false;
     1023      RunAlgorithm(rapga);
     1024      Assert.AreEqual(982.00, GetDoubleResult(rapga, "BestQuality"));
     1025      Assert.AreEqual(982.00, GetDoubleResult(rapga, "CurrentAverageQuality"));
     1026      Assert.AreEqual(982.00, GetDoubleResult(rapga, "CurrentWorstQuality"));
     1027      Assert.AreEqual(29100, GetIntResult(rapga, "EvaluatedSolutions"));
     1028    }
     1029
     1030    private RAPGA CreateRAPGASchedulingSample() {
     1031      #region Problem Configuration
     1032      JobShopSchedulingProblem problem = new JobShopSchedulingProblem();
     1033      #endregion
     1034
     1035      #region Algorithm Configuration
     1036      RAPGA rapga = new RAPGA();
     1037      rapga.Engine = new SequentialEngine();
     1038      rapga.Name = "RAPGA - Job Shop Scheduling";
     1039      rapga.Description = "A relevant alleles preserving genetic algorithm which solves a job shop scheduling problem";
     1040      rapga.Problem = problem;
     1041      rapga.Mutator = rapga.MutatorParameter.ValidValues.OfType<JSMSwapManipulator>().First();
     1042      rapga.Seed.Value = 0;
     1043      return rapga;
     1044      #endregion
     1045    }
     1046    #endregion
     1047    #endregion
     1048
    10081049    #region Helpers
    10091050    private void ConfigureEvolutionStrategyParameters<R, M, SC, SR, SM>(EvolutionStrategy es, int popSize, int children, int parentsPerChild, int maxGens, bool plusSelection)
Note: See TracChangeset for help on using the changeset viewer.