Changeset 11638 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Timestamp:
- 12/03/14 17:04:46 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 11504,11532,11536,11623
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeStringFormatter.cs
r11460 r11638 20 20 #endregion 21 21 22 using System.Linq;23 22 using System.Text; 24 23 using HeuristicLab.Common; … … 59 58 strBuilder.Append("("); 60 59 // internal nodes or leaf nodes? 61 if (node.Subtree s.Count()> 0) {60 if (node.SubtreeCount > 0) { 62 61 // symbol on same line as '(' 63 62 strBuilder.AppendLine(node.ToString()); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/EmptySymbolicExpressionTreeGrammar.cs
r11494 r11638 27 27 using HeuristicLab.Common; 28 28 using HeuristicLab.Core; 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 30 30 31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 32 33 [StorableClass] 31 34 internal sealed class EmptySymbolicExpressionTreeGrammar : NamedItem, ISymbolicExpressionTreeGrammar { 35 [Storable] 32 36 private ISymbolicExpressionGrammar grammar; 37 38 [StorableConstructor] 39 private EmptySymbolicExpressionTreeGrammar(bool deserializing) : base(deserializing) {} 33 40 internal EmptySymbolicExpressionTreeGrammar(ISymbolicExpressionGrammar grammar) 34 41 : base() { … … 128 135 throw new NotSupportedException(); 129 136 } 130 137 138 #pragma warning disable 0169 //disable usage warning 131 139 public event EventHandler Changed; 140 #pragma warning restore 0169 132 141 #endregion 133 142 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r11499 r11638 11 11 <RootNamespace>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</AssemblyName> 13 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 14 14 <TargetFrameworkProfile> 15 15 </TargetFrameworkProfile> … … 47 47 <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> 48 48 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 49 <Prefer32Bit>false</Prefer32Bit> 49 50 </PropertyGroup> 50 51 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 56 57 <WarningLevel>4</WarningLevel> 57 58 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 59 <Prefer32Bit>false</Prefer32Bit> 58 60 </PropertyGroup> 59 61 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> … … 65 67 <ErrorReport>prompt</ErrorReport> 66 68 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 69 <Prefer32Bit>false</Prefer32Bit> 67 70 </PropertyGroup> 68 71 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> … … 74 77 <ErrorReport>prompt</ErrorReport> 75 78 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 79 <Prefer32Bit>false</Prefer32Bit> 76 80 </PropertyGroup> 77 81 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> … … 83 87 <ErrorReport>prompt</ErrorReport> 84 88 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 89 <Prefer32Bit>false</Prefer32Bit> 85 90 </PropertyGroup> 86 91 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> … … 92 97 <ErrorReport>prompt</ErrorReport> 93 98 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 99 <Prefer32Bit>false</Prefer32Bit> 94 100 </PropertyGroup> 95 101 <ItemGroup> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
r11208 r11638 132 132 133 133 private static int GetBranchLevel(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode point) { 134 if (point == null || point.Parent == null)135 return int.MaxValue;136 137 134 if (root == point) 138 135 return 0; 139 140 if (root == point.Parent)141 return 1;142 143 var p = point.Parent;144 int level = 1;145 146 while (p != root) {147 level++;148 p = p.Parent;149 150 if (p == null)151 return int.MaxValue; // root is not an ancestor of point152 }153 154 return level;155 }156 157 private static int GetBranchLevelOld(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode point) {158 136 foreach (var subtree in root.Subtrees) { 159 137 int branchLevel = GetBranchLevel(subtree, point);
Note: See TracChangeset
for help on using the changeset viewer.