Free cookie consent management tool by TermsFeed Policy Generator

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

#1886

  • improved unwanted mutation analyzer
  • added test functions crossover performance analyzer
File:
1 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;
Note: See TracChangeset for help on using the changeset viewer.