- Timestamp:
- 01/04/14 13:18:52 (11 years ago)
- Location:
- branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Mappers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Mappers/BreathFirstMapper.cs
r10229 r10277 98 98 99 99 var newNode = GetNewChildNode(current.Item1, genotype, grammar, genotypeIndex, random); 100 int arity = SampleArity(random, newNode, maxSubtreeCount - currSubtreeCount );100 int arity = SampleArity(random, newNode, maxSubtreeCount - currSubtreeCount, grammar); 101 101 102 102 if (arity < 0) { -
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Mappers/DepthFirstMapper.cs
r10276 r10277 101 101 102 102 var newNode = GetNewChildNode(current.Item1, genotype, grammar, genotypeIndex, random); 103 int arity = SampleArity(random, newNode, maxSubtreeCount - currSubtreeCount );103 int arity = SampleArity(random, newNode, maxSubtreeCount - currSubtreeCount, grammar); 104 104 105 105 if (arity < 0) { -
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/Mappers/GenotypeToPhenotypeMapper.cs
r10228 r10277 109 109 /// <param name="node">node, for which a random arity is determined</param> 110 110 /// <param name="maxAllowedArity">the resulting arity must not exceed this maximum arity</param> 111 /// <param name="grammar">symbolic expression grammar to use</param> 111 112 /// <returns>random arity in the interval [minArity, maxArity] of the node or 112 113 /// -1, if minArity exceeds maxAllowedArity</returns> 113 114 protected int SampleArity(IRandom random, 114 115 ISymbolicExpressionTreeNode node, 115 int maxAllowedArity) { 116 int minArity = node.Symbol.MinimumArity; 117 int maxArity = node.Symbol.MaximumArity; 116 int maxAllowedArity, 117 ISymbolicExpressionGrammar grammar) { 118 119 int minArity = grammar.GetMinimumSubtreeCount(node.Symbol); 120 int maxArity = grammar.GetMaximumSubtreeCount(node.Symbol); 118 121 119 122 if (maxAllowedArity < maxArity) {
Note: See TracChangeset
for help on using the changeset viewer.