Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/13/12 10:31:54 (12 years ago)
Author:
ascheibe
Message:

#1886 added mutation performance analyzer for test functions

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3
Files:
1 added
3 edited

Legend:

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

    r9044 r9045  
    5555      mAnalyzer.PermutationAfterMutationParameter.ActualName = "Assignment";
    5656
    57       varRemover.VariableNameParameter.Value.Value = "TSPTourClone";
     57      varRemover.VariableNameParameter.Value.Value = "AssignmentClone";
    5858    }
    5959  }
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj

    r9044 r9045  
    120120    <Compile Include="AfterCrossoverCombinedOperator.cs" />
    121121    <Compile Include="AfterMutationCombinedOperator.cs" />
     122    <Compile Include="CombinedOperators\TFAfterMutationCombinedOperator.cs" />
    122123    <Compile Include="CombinedOperators\TFAfterCrossoverCombinedOperator.cs" />
    123124    <Compile Include="CombinedOperators\TSPAfterMutationCombinedOperator.cs" />
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs

    r8867 r9045  
    2525using HeuristicLab.Core;
    2626using HeuristicLab.Data;
    27 using HeuristicLab.Encodings.PermutationEncoding;
    2827using HeuristicLab.Optimization;
    2928using HeuristicLab.Parameters;
     
    5049      get { return (ILookupParameter<DoubleValue>)Parameters["QualityAfterMutation"]; }
    5150    }
    52     public ILookupParameter<Permutation> PermutationBeforeMutationParameter {
    53       get { return (ILookupParameter<Permutation>)Parameters["PermutationBeforeMutation"]; }
     51    public ILookupParameter<IItem> PermutationBeforeMutationParameter {
     52      get { return (ILookupParameter<IItem>)Parameters["PermutationBeforeMutation"]; }
    5453    }
    55     public ILookupParameter<Permutation> PermutationAfterMutationParameter {
    56       get { return (ILookupParameter<Permutation>)Parameters["PermutationAfterMutation"]; }
     54    public ILookupParameter<IItem> PermutationAfterMutationParameter {
     55      get { return (ILookupParameter<IItem>)Parameters["PermutationAfterMutation"]; }
    5756    }
    5857    public ILookupParameter<ItemCollection<IItem>> OperatorsParameter {
     
    9695      QualityAfterMutationParameter.ActualName = "TSPTourLengthM";
    9796
    98       Parameters.Add(new LookupParameter<Permutation>("PermutationBeforeMutation"));
     97      Parameters.Add(new LookupParameter<IItem>("PermutationBeforeMutation"));
    9998      PermutationBeforeMutationParameter.ActualName = "TSPTourClone";
    10099
    101       Parameters.Add(new LookupParameter<Permutation>("PermutationAfterMutation"));
     100      Parameters.Add(new LookupParameter<IItem>("PermutationAfterMutation"));
    102101      PermutationAfterMutationParameter.ActualName = "TSPTour";
    103102
     
    117116        SimilarityCalculatorParameter.Value = OperatorsParameter.ActualValue.OfType<ISingleObjectiveSolutionSimilarityCalculator>().FirstOrDefault();
    118117      }
     118      qualityPlotHelper.InitializePlot(Results, "Mutation Quality", "Solution Index", "Absolut Quality Difference");
     119      diversityPlotHelper.InitializePlot(Results, "Mutation Diversity", "Solution Index", "Diversity");
    119120      Reset();
    120121    }
     
    126127      var qualityCX = QualityAfterCrossoverParameter.ActualValue.Value;
    127128      var qualityM = QualityAfterMutationParameter.ActualValue.Value;
    128       var permutationBefore = PermutationBeforeMutationParameter.ActualValue;
    129       var permutationAfter = PermutationAfterMutationParameter.ActualValue;
     129      var solutionBefore = PermutationBeforeMutationParameter.ActualValue;
     130      var solutionAfter = PermutationAfterMutationParameter.ActualValue;
    130131
    131       if (permutationBefore != null) {
    132         qualityPlotHelper.InitializePlot(Results, "Mutation Quality", "Solution Index", "Absolut Quality Difference");
    133         diversityPlotHelper.InitializePlot(Results, "Mutation Diversity", "Solution Index", "Diversity");
     132      Scope permutationBeforeScope = new Scope();
     133      Scope permutationAfterScope = new Scope();
     134      permutationBeforeScope.Variables.Add(new Variable(PermutationAfterMutationParameter.ActualName, solutionBefore));
     135      permutationAfterScope.Variables.Add(new Variable(PermutationAfterMutationParameter.ActualName, solutionAfter));
    134136
    135         Scope permutationBeforeScope = new Scope();
    136         Scope permutationAfterScope = new Scope();
    137         permutationBeforeScope.Variables.Add(new Variable(PermutationAfterMutationParameter.ActualName, permutationBefore));
    138         permutationAfterScope.Variables.Add(new Variable(PermutationAfterMutationParameter.ActualName, permutationAfter));
    139 
    140         divPoint = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(permutationBeforeScope, permutationAfterScope));
    141         curPoint = new Point2D<double>(cnt++, qualityCX - qualityM);
     137      divPoint = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(permutationBeforeScope, permutationAfterScope));
     138      curPoint = new Point2D<double>(cnt++, qualityCX - qualityM);
    142139
    143140
    144         string curGenStr = GenerationsParameter.ActualValue.Value.ToString();
     141      string curGenStr = GenerationsParameter.ActualValue.Value.ToString();
    145142
    146         qualityPlotHelper.AddPoint(curGenStr, curPoint);
    147         diversityPlotHelper.AddPoint(curGenStr, divPoint);
     143      qualityPlotHelper.AddPoint(curGenStr, curPoint);
     144      diversityPlotHelper.AddPoint(curGenStr, divPoint);
    148145
    149         if (GenerationsParameter.ActualValue.Value != 0) {
    150           if (GenerationsParameter.ActualValue.Value > lastGeneration) {
    151             Reset();
    152           }
     146      if (GenerationsParameter.ActualValue.Value != 0) {
     147        if (GenerationsParameter.ActualValue.Value > lastGeneration) {
     148          Reset();
    153149        }
    154150      }
Note: See TracChangeset for help on using the changeset viewer.