Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9044


Ignore:
Timestamp:
12/12/12 23:28:52 (12 years ago)
Author:
ascheibe
Message:

#1886

  • improved unwanted mutation analyzer
  • added test functions crossover performance analyzer
Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3
Files:
10 added
5 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs

    r9020 r9044  
    5353      get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; }
    5454    }
    55     public ILookupParameter<ItemArray<Permutation>> ParentsParameter {
    56       get { return (ScopeTreeLookupParameter<Permutation>)Parameters["Parents"]; }
    57     }
    5855    public ILookupParameter<ItemArray<DoubleValue>> ParentsQualityParameter {
    5956      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["ParentsQuality"]; }
    6057    }
    61     public ILookupParameter<Permutation> ChildParameter {
    62       get { return ((LookupParameter<Permutation>)Parameters["Child"]); }
    63     }
    6458    public ILookupParameter<DoubleValue> QualityParameter {
    6559      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
     
    6761    public IValueParameter<ISingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter {
    6862      get { return (IValueParameter<ISingleObjectiveSolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; }
     63    }
     64    public IValueParameter<IUnwantedMutationAnalyzer> UnwantedMutationAnalyzerParameter {
     65      get { return (IValueParameter<IUnwantedMutationAnalyzer>)Parameters["UnwantedMutationAnalyzer"]; }
    6966    }
    7067    public ILookupParameter<ItemCollection<IItem>> OperatorsParameter {
     
    117114
    118115      Parameters.Add(new ScopeTreeLookupParameter<Permutation>("Parents", "The parent permutations which have been crossed."));
    119       ParentsParameter.ActualName = "TSPTour";
    120116
    121117      Parameters.Add(new LookupParameter<Permutation>("Child", "The child permutation resulting from the crossover."));
    122       ChildParameter.ActualName = "TSPTour";
    123118
    124119      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("ParentsQuality", "The quality of the parent solutions."));
     
    129124
    130125      Parameters.Add(new ValueParameter<ISingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator"));
     126      Parameters.Add(new ValueParameter<IUnwantedMutationAnalyzer>("UnwantedMutationAnalyzer"));
    131127      Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms."));
    132128      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise"));
     
    187183
    188184      Point2D<double> worseQualityPoint, betterQualityPoint, childDiversityToWorseParent, childDiversityToBetterParent, diversityPointParent, qualityPointParent, unwantedMutationPoint;
    189       var parent1 = ParentsParameter.ActualValue.First();
    190       var parent2 = ParentsParameter.ActualValue.Last();
    191185      var qualityParent1 = ParentsQualityParameter.ActualValue.First().Value;
    192186      var qualityParent2 = ParentsQualityParameter.ActualValue.Last().Value;
    193       var child = ChildParameter.ActualValue;
    194187      var qualityChild = QualityParameter.ActualValue.Value;
    195188
     
    199192      diversityPointParent = new Point2D<double>(cnt, parentDiversity);
    200193      qualityPointParent = new Point2D<double>(cnt, Math.Abs(qualityParent1 - qualityParent2));
    201       unwantedMutationPoint = new Point2D<double>(cnt, UnwantedMutationAnalyzer.AnalyzeUnwantedMutationsForPermutationEncoding(parent1, parent2, child));
     194      if (UnwantedMutationAnalyzerParameter.Value != null) {
     195        unwantedMutationPoint = new Point2D<double>(cnt, UnwantedMutationAnalyzerParameter.Value.AnalyzeUnwantedMutations(ExecutionContext.Scope.SubScopes.First(), ExecutionContext.Scope.SubScopes.Last(), ExecutionContext.Scope));
     196      } else {
     197        //TODO: this is not a good solution
     198        unwantedMutationPoint = new Point2D<double>(cnt, 0.0);
     199      }
    202200
    203201      double worseQuality, betterQuality;
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj

    r9042 r9044  
    120120    <Compile Include="AfterCrossoverCombinedOperator.cs" />
    121121    <Compile Include="AfterMutationCombinedOperator.cs" />
    122     <Compile Include="TSPAfterMutationCombinedOperator.cs" />
    123     <Compile Include="TSPAfterCrossoverCombinedOperator.cs" />
    124     <Compile Include="QAPAfterMutationCombinedOperator.cs" />
    125     <Compile Include="QAPAfterCrossoverCombinedOperator.cs" />
     122    <Compile Include="CombinedOperators\TFAfterCrossoverCombinedOperator.cs" />
     123    <Compile Include="CombinedOperators\TSPAfterMutationCombinedOperator.cs" />
     124    <Compile Include="CombinedOperators\TSPAfterCrossoverCombinedOperator.cs" />
     125    <Compile Include="CombinedOperators\QAPAfterMutationCombinedOperator.cs" />
     126    <Compile Include="CombinedOperators\QAPAfterCrossoverCombinedOperator.cs" />
    126127    <Compile Include="InitializableOperator.cs" />
    127     <Compile Include="UnwantedMutationAnalyzer.cs" />
     128    <Compile Include="UnwantedMutationAnalyzers\PermutationUnwantedMutationAnalyzer.cs" />
     129    <Compile Include="UnwantedMutationAnalyzers\IUnwantedMutationAnalyzer.cs" />
     130    <Compile Include="UnwantedMutationAnalyzers\UnwantedMutationAnalyzer.cs" />
    128131    <Compile Include="VariableRemover.cs" />
    129132    <Compile Include="LinearLeastSquaresFitting.cs" />
     
    149152    <None Include="Properties\AssemblyInfo.cs.frame" />
    150153  </ItemGroup>
     154  <ItemGroup />
    151155  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    152156  <PropertyGroup>
Note: See TracChangeset for help on using the changeset viewer.