Changeset 12287 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs
- Timestamp:
- 04/06/15 16:39:55 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs
r12155 r12287 39 39 public SymbolicExpressionTreeBottomUpSimilarityCalculator() { } 40 40 protected override bool IsCommutative { get { return true; } } 41 42 public bool MatchVariableWeights { get; set; } 43 public bool MatchConstantValues { get; set; } 41 44 42 45 [StorableConstructor] … … 216 219 } 217 220 218 private st atic string GetLabel(ISymbolicExpressionTreeNode node) {221 private string GetLabel(ISymbolicExpressionTreeNode node) { 219 222 if (node.SubtreeCount > 0) 220 223 return node.Symbol.Name; … … 222 225 var constant = node as ConstantTreeNode; 223 226 if (constant != null) 224 return constant.Value.ToString(CultureInfo.InvariantCulture);227 return MatchConstantValues ? constant.Value.ToString(CultureInfo.InvariantCulture) : node.Symbol.Name; 225 228 226 229 var variable = node as VariableTreeNode; 227 230 if (variable != null) 228 return variable.Weight +variable.VariableName;231 return MatchVariableWeights ? variable.Weight + variable.VariableName : variable.VariableName; 229 232 230 233 return node.ToString();
Note: See TracChangeset
for help on using the changeset viewer.