Changeset 7669 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/CutPoint.cs
- Timestamp:
- 03/28/12 15:47:26 (12 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure
- Property svn:ignore
-
old new 3 3 *.resharper 4 4 *.suo 5 *.user 5 6 *.vsp 6 7 Doxygen 8 FxCopResults.txt 7 9 Google.ProtocolBuffers-0.9.1.dll 8 10 HeuristicLab 3.3.5.1.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged eligible /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged eligible /branches/Benchmarking/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 6917-7005 /branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 4656-4721 /branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 5815-6180 /branches/DataAnalysis/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 4458-4459,4462,4464 /branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 6284-6795 /branches/HeuristicLab.Crossovers/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 7343-7503 /branches/NET40/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 5138-5162 /branches/ParallelEngine/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 5175-5192 /branches/QAPAlgorithms/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 6828 /branches/SuccessProgressAnalysis/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 5370-5682 /branches/Trunk/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 6829-6865 /branches/VNS/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 5594-5752 /branches/histogram/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/CutPoint.cs
r7270 r7669 22 22 23 23 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 24 internalclass CutPoint {24 public class CutPoint { 25 25 public ISymbolicExpressionTreeNode Parent { get; set; } 26 26 public ISymbolicExpressionTreeNode Child { get; set; } … … 39 39 this.Child = null; 40 40 } 41 42 public bool IsMatchingPointType(ISymbolicExpressionTreeNode newChild) { 43 var parent = this.Parent; 44 if (newChild == null) { 45 // make sure that one subtree can be removed and that only the last subtree is removed 46 return parent.Grammar.GetMinimumSubtreeCount(parent.Symbol) < parent.SubtreeCount && 47 this.ChildIndex == parent.SubtreeCount - 1; 48 } else { 49 // check syntax constraints of direct parent - child relation 50 if (!parent.Grammar.ContainsSymbol(newChild.Symbol) || 51 !parent.Grammar.IsAllowedChildSymbol(parent.Symbol, newChild.Symbol, this.ChildIndex)) 52 return false; 53 54 bool result = true; 55 // check point type for the whole branch 56 newChild.ForEachNodePostfix((n) => { 57 result = 58 result && 59 parent.Grammar.ContainsSymbol(n.Symbol) && 60 n.SubtreeCount >= parent.Grammar.GetMinimumSubtreeCount(n.Symbol) && 61 n.SubtreeCount <= parent.Grammar.GetMaximumSubtreeCount(n.Symbol); 62 }); 63 return result; 64 } 65 } 41 66 } 42 67 }
Note: See TracChangeset
for help on using the changeset viewer.