Changeset 10456 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/LayoutEngines
- Timestamp:
- 02/15/14 13:50:37 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/branches/HLScript/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding (added) merged: 10358 /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 10346,10359
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/LayoutEngines/SymbolicExpressionTreeLayoutAdapter.cs
r10269 r10456 28 28 public class SymbolicExpressionTreeLayoutAdapter : ILayoutAdapter<ISymbolicExpressionTreeNode> { 29 29 // default conversion function between ISymbolicExpressionTreeNode and ILayoutNode<ISymbolicExpressionTree> 30 ILayoutNode<ISymbolicExpressionTreeNode> defaultConvert(ISymbolicExpressionTreeNode node) {30 static ILayoutNode<ISymbolicExpressionTreeNode> DefaultConvert(ISymbolicExpressionTreeNode node) { 31 31 var layoutNode = new LayoutNode<ISymbolicExpressionTreeNode> { Content = node }; 32 32 layoutNode.Ancestor = layoutNode; … … 40 40 // return an enumerable containing all the layout nodes 41 41 public IEnumerable<ILayoutNode<ISymbolicExpressionTreeNode>> Convert(ISymbolicExpressionTreeNode root, Func<ISymbolicExpressionTreeNode, ILayoutNode<ISymbolicExpressionTreeNode>> convertFunc = null) { 42 var rootLayoutNode = convertFunc == null ? defaultConvert(root) : convertFunc(root);42 var rootLayoutNode = convertFunc == null ? DefaultConvert(root) : convertFunc(root); 43 43 rootLayoutNode.Ancestor = rootLayoutNode; 44 44 … … 63 63 for (int i = 0; i < layoutNode.Content.SubtreeCount; ++i) { 64 64 var subtree = layoutNode.Content.GetSubtree(i); 65 var childLayoutNode = convertFunc == null ? defaultConvert(subtree) : convertFunc(subtree);65 var childLayoutNode = convertFunc == null ? DefaultConvert(subtree) : convertFunc(subtree); 66 66 childLayoutNode.Parent = layoutNode; 67 67 childLayoutNode.Number = i;
Note: See TracChangeset
for help on using the changeset viewer.