Changeset 12922 for branches/HeuristicLab.Algorithms.IteratedSentenceConstruction/HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction/3.3/Policies/SymbolicExpressionConstructionPolicyBase.cs
- Timestamp:
- 08/27/15 16:55:07 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Algorithms.IteratedSentenceConstruction/HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction/3.3/Policies/SymbolicExpressionConstructionPolicyBase.cs
r12909 r12922 46 46 47 47 protected SymbolicExpressionConstructionPolicyBase() { 48 48 49 } 49 50 … … 106 107 // and add child node to parent 107 108 var childNode = alts[selectedIdx].CreateTreeNode(); 108 if (childNode.HasLocalParameters) childNode.ResetLocalParameters(Random); 109 if (childNode.HasLocalParameters) { 110 throw new NotSupportedException("Symbols with parameters are not supported by construction policies for symbolic expressions. Try to reformulate the problem so that only discrete actions are necessary"); 111 // childNode.ResetLocalParameters(Random); 112 } 109 113 110 114 Contract.Assert(parent.SubtreeCount == childIdx); … … 113 117 114 118 // push new slots 115 for (int chIdx = childNode.Symbol.MinimumArity- 1; chIdx >= 0; chIdx--) {119 for (int chIdx = g.GetMinimumSubtreeCount(childNode.Symbol) - 1; chIdx >= 0; chIdx--) { 116 120 int minForChild = g.GetAllowedChildSymbols(childNode.Symbol, chIdx).Min(a => g.GetMinimumExpressionLength(a)); // min length of all possible alts for the slot 117 121 openSlots.Push(new Slot() { parent = childNode, childIdx = chIdx, minSize = minForChild });
Note: See TracChangeset
for help on using the changeset viewer.