Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/06/15 16:39:55 (9 years ago)
Author:
bburlacu
Message:

#1772: Added storable attributes to the before/after evolution tracking operators in HeuristicLab.Problems.DataAnalysis.Symbolic. Very small changes to the trace calculator (updated license header, removed old sample count code).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs

    r12155 r12287  
    3939    public SymbolicExpressionTreeBottomUpSimilarityCalculator() { }
    4040    protected override bool IsCommutative { get { return true; } }
     41
     42    public bool MatchVariableWeights { get; set; }
     43    public bool MatchConstantValues { get; set; }
    4144
    4245    [StorableConstructor]
     
    216219    }
    217220
    218     private static string GetLabel(ISymbolicExpressionTreeNode node) {
     221    private string GetLabel(ISymbolicExpressionTreeNode node) {
    219222      if (node.SubtreeCount > 0)
    220223        return node.Symbol.Name;
     
    222225      var constant = node as ConstantTreeNode;
    223226      if (constant != null)
    224         return constant.Value.ToString(CultureInfo.InvariantCulture);
     227        return MatchConstantValues ? constant.Value.ToString(CultureInfo.InvariantCulture) : node.Symbol.Name;
    225228
    226229      var variable = node as VariableTreeNode;
    227230      if (variable != null)
    228         return variable.Weight + variable.VariableName;
     231        return MatchVariableWeights ? variable.Weight + variable.VariableName : variable.VariableName;
    229232
    230233      return node.ToString();
Note: See TracChangeset for help on using the changeset viewer.