Changeset 12924 for branches/HeuristicLab.Algorithms.IteratedSentenceConstruction/HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction/3.3/StateFunctions
- Timestamp:
- 08/28/15 17:50:53 (9 years ago)
- Location:
- branches/HeuristicLab.Algorithms.IteratedSentenceConstruction/HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction/3.3/StateFunctions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Algorithms.IteratedSentenceConstruction/HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction/3.3/StateFunctions/DefaultStateFunction.cs
r12923 r12924 13 13 [StorableClass] 14 14 [Item("DefaultStateFunction", "")] 15 internalclass DefaultStateFunction : Item, IStateFunction {15 public class DefaultStateFunction : Item, IStateFunction { 16 16 public DefaultStateFunction() 17 17 : base() { … … 19 19 20 20 public object CreateState(ISymbolicExpressionTreeNode root, List<ISymbol> actions, ISymbolicExpressionTreeNode parentNode, int childIdx) { 21 return string.Join(",", actions.Select(a => a.Name)); 21 return string.Join(",", actions.Select(a => a.Name)); // TODO: perf 22 22 } 23 23 -
branches/HeuristicLab.Algorithms.IteratedSentenceConstruction/HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction/3.3/StateFunctions/ParentChildStateFunction.cs
r12923 r12924 14 14 [StorableClass] 15 15 [Item("ParentChildStateFunction", "")] 16 internalclass ParentChildStateFunction : Item, IStateFunction {16 public class ParentChildStateFunction : Item, IStateFunction { 17 17 public ParentChildStateFunction() 18 18 : base() { … … 20 20 21 21 public object CreateState(ISymbolicExpressionTreeNode root, List<ISymbol> actions, ISymbolicExpressionTreeNode parentNode, int childIdx) { 22 return (parentNode == null ? "" : parentNode.Symbol.Name) + childIdx; 22 if (parentNode == null) return string.Empty; 23 else return parentNode.Symbol.Name + "." + string.Join(".", parentNode.Subtrees.Select(t => t.Symbol.Name)); 23 24 } 24 25
Note: See TracChangeset
for help on using the changeset viewer.