- Timestamp:
- 03/02/15 16:29:24 (10 years ago)
- 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 34 34 [StorableClass] 35 35 [Item("SymbolicExpressionTreeBottomUpSimilarityCalculator", "A similarity calculator which uses the tree bottom-up distance as a similarity metric.")] 36 public class SymbolicExpressionTreeBottomUpSimilarityCalculator : S ingleObjectiveSolutionSimilarityCalculator {36 public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SolutionSimilarityCalculator { 37 37 private readonly HashSet<string> commutativeSymbols = new HashSet<string> { "Addition", "Multiplication", "Average", "And", "Or", "Xor" }; 38 38 39 public SymbolicExpressionTreeBottomUpSimilarityCalculator() { } 39 40 protected override bool IsCommutative { get { return true; } } 40 41 public SymbolicExpressionTreeBottomUpSimilarityCalculator() { }42 41 43 42 [StorableConstructor] … … 63 62 64 63 public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) { 64 if (leftSolution == rightSolution) 65 return 1.0; 66 65 67 var t1 = leftSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree; 66 68 var t2 = rightSolution.Variables[SolutionVariableName].Value as ISymbolicExpressionTree; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs
r12070 r12103 30 30 [StorableClass] 31 31 [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 { 35 33 [Storable] 36 34 private readonly SymbolicExpressionTreeNodeEqualityComparer comparer; … … 44 42 set { comparer.MatchConstantValues = value; } 45 43 } 44 45 protected override bool IsCommutative { get { return true; } } 46 46 47 47 [StorableConstructor]
Note: See TracChangeset
for help on using the changeset viewer.