Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/21/15 15:55:47 (10 years ago)
Author:
bburlacu
Message:

#2326: Addressed the issues found by the reviewer.

Location:
branches/SymbolicExpressionTreeDiversityAnalyzers/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SymbolicExpressionTreeDiversityAnalyzers/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r12030 r12049  
    119119      set { ProblemDataParameter.Value = value; }
    120120    }
    121 
    122121    public ISymbolicDataAnalysisGrammar SymbolicExpressionTreeGrammar {
    123122      get { return SymbolicExpressionTreeGrammarParameter.Value; }
     
    128127      set { SymbolicExpressionTreeInterpreterParameter.Value = value; }
    129128    }
    130 
    131129    public IntValue MaximumSymbolicExpressionTreeDepth {
    132130      get { return MaximumSymbolicExpressionTreeDepthParameter.Value; }
     
    144142      get { return RelativeNumberOfEvaluatedSamplesParameter.Value; }
    145143    }
    146 
    147144    public IntRange FitnessCalculationPartition {
    148145      get { return FitnessCalculationPartitionParameter.Value; }
     
    352349        op.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
    353350      }
     351      foreach (var op in operators.OfType<SymbolicDataAnalysisBottomUpDiversityAnalyzer>()) {
     352        var sim = op.SimilarityCalculator as SymbolicExpressionTreeBottomUpSimilarityCalculator;
     353        if (sim == null) {
     354          op.SimilarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator {
     355            SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName
     356          };
     357        } else {
     358          sim.SolutionVariableName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
     359        }
     360      }
    354361    }
    355362
  • branches/SymbolicExpressionTreeDiversityAnalyzers/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs

    r12028 r12049  
    6060
    6161    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
     62      if (leftSolution == rightSolution)
     63        return 1.0;
     64
    6265      var t1 = leftSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
    6366      var t2 = rightSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
  • branches/SymbolicExpressionTreeDiversityAnalyzers/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs

    r12029 r12049  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    6363
    6464    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
     65      if (leftSolution == rightSolution)
     66        return 1.0;
     67
    6568      var leftValues = (DoubleArray)leftSolution.Variables["EstimatedValues"].Value;
    6669      var rightValues = (DoubleArray)rightSolution.Variables["EstimatedValues"].Value;
Note: See TracChangeset for help on using the changeset viewer.