Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/02/15 16:29:24 (10 years ago)
Author:
mkommend
Message:

#2326: Merged all branch changes in the trunk.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs

    r12070 r12103  
    3434  [StorableClass]
    3535  [Item("SymbolicExpressionTreeBottomUpSimilarityCalculator", "A similarity calculator which uses the tree bottom-up distance as a similarity metric.")]
    36   public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
     36  public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SolutionSimilarityCalculator {
    3737    private readonly HashSet<string> commutativeSymbols = new HashSet<string> { "Addition", "Multiplication", "Average", "And", "Or", "Xor" };
    3838
     39    public SymbolicExpressionTreeBottomUpSimilarityCalculator() { }
    3940    protected override bool IsCommutative { get { return true; } }
    40 
    41     public SymbolicExpressionTreeBottomUpSimilarityCalculator() { }
    4241
    4342    [StorableConstructor]
     
    6362
    6463    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
     64      if (leftSolution == rightSolution)
     65        return 1.0;
     66
    6567      var t1 = leftSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
    6668      var t2 = rightSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs

    r12070 r12103  
    3030  [StorableClass]
    3131  [Item("SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator", "A similarity calculator based on the size of the maximum common subtree between two trees")]
    32   public class SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
    33     protected override bool IsCommutative { get { return true; } }
    34 
     32  public class SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator : SolutionSimilarityCalculator {
    3533    [Storable]
    3634    private readonly SymbolicExpressionTreeNodeEqualityComparer comparer;
     
    4442      set { comparer.MatchConstantValues = value; }
    4543    }
     44
     45    protected override bool IsCommutative { get { return true; } }
    4646
    4747    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.