Changeset 18148
- Timestamp:
- 12/16/21 14:54:09 (3 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol merged: 18144-18145,18147
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 18145
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeSimilarityComparer.cs
r18132 r18148 6 6 [StorableType("c4de8ab2-616d-4c73-9f9c-59545ac38199")] 7 7 public interface ISymbolicExpressionTreeNodeSimilarityComparer : IEqualityComparer<ISymbolicExpressionTreeNode>, IItem { 8 bool Match ParameterValues { get; set; }8 bool MatchNumericValues { get; set; } 9 9 bool MatchVariableWeights { get; set; } 10 10 bool MatchVariableNames { get; set; } -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 18144-18145,18147
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r18132 r18148 153 153 <SubType>Code</SubType> 154 154 </Compile> 155 <Compile Include="Converters\ConstantsToNumberConverter.cs" /> 155 156 <Compile Include="Converters\LinearModelToTreeConverter.cs" /> 156 157 <Compile Include="Converters\TreeSimplifier.cs" /> -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Constant.cs
r18132 r18148 35 35 public override int MaximumArity => maximumArity; 36 36 37 [Storable] 37 38 public double Value { get; set; } 38 39 -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/NumberTreeNode.cs
r18132 r18148 44 44 public NumberTreeNode(Number numberSymbol) : base(numberSymbol) { } 45 45 46 public NumberTreeNode(double value) : this(new Number()) { 47 Value = value; 48 } 49 46 50 public override bool HasLocalParameters => true; 47 51 -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs
r18132 r18148 39 39 40 40 public bool MatchParameterValues { 41 get { return comparer.Match ParameterValues; }42 set { comparer.Match ParameterValues = value; }41 get { return comparer.MatchNumericValues; } 42 set { comparer.MatchNumericValues = value; } 43 43 } 44 44 … … 59 59 public SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator() { 60 60 comparer = new SymbolicExpressionTreeNodeEqualityComparer { 61 Match ParameterValues = true,61 MatchNumericValues = true, 62 62 MatchVariableNames = true, 63 63 MatchVariableWeights = true … … 67 67 public SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator(bool matchVariableWeights, bool matchParameterValues) { 68 68 comparer = new SymbolicExpressionTreeNodeEqualityComparer { 69 Match ParameterValues = matchParameterValues,69 MatchNumericValues = matchParameterValues, 70 70 MatchVariableNames = true, 71 71 MatchVariableWeights = matchVariableWeights -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs
r18141 r18148 42 42 [Storable] 43 43 private bool matchNumericValues; 44 public bool Match ParameterValues {44 public bool MatchNumericValues { 45 45 get { return matchNumericValues; } 46 46 set { matchNumericValues = value; } … … 90 90 var cb = b as INumericTreeNode; 91 91 if (cb == null) return false; 92 return (!Match ParameterValues || ca.Value.Equals(cb.Value));92 return (!MatchNumericValues || ca.Value.Equals(cb.Value)); 93 93 } 94 94 return false; -
trunk/HeuristicLab.Tests
- Property svn:mergeinfo changed
/branches/3140_NumberSymbol/HeuristicLab.Tests merged: 18145,18147
- Property svn:mergeinfo changed
-
trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeSimplifierTest.cs
r18132 r18148 287 287 var formatter = new SymbolicExpressionTreeStringFormatter(); 288 288 var importer = new SymbolicExpressionImporter(); 289 var actualTree = TreeSimplifier.Simplify(importer.Import(original)); 289 var originalTree = importer.Import(original); 290 originalTree = ConstantsToNumberConverter.Convert(originalTree); 291 var actualTree = TreeSimplifier.Simplify(originalTree); 290 292 var expectedTree = importer.Import(expected); 291 293 Assert.AreEqual(formatter.Format(expectedTree), formatter.Format(actualTree)); -
trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionTreeBottomUpSimilarityCalculatorTest.cs
r18132 r18148 82 82 var sw = new Stopwatch(); 83 83 84 var similarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { MatchVariableWeights = false, Match ParameterValues = false };84 var similarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { MatchVariableWeights = false, MatchNumericValues = false }; 85 85 86 86 sw.Start(); … … 117 117 var trees = Util.CreateRandomTrees(twister, ds, grammar, N, 100); 118 118 119 var similarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { Match ParameterValues = strict, MatchVariableWeights = strict };119 var similarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { MatchNumericValues = strict, MatchVariableWeights = strict }; 120 120 var bottomUpSimilarity = 0d; 121 121 for (int i = 0; i < trees.Length - 1; ++i) {
Note: See TracChangeset
for help on using the changeset viewer.