Changeset 15289 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator
- Timestamp:
- 07/26/17 19:34:13 (7 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP
-
Property
svn:ignore
set to
*.user
-
Property
svn:ignore
set to
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator/CodeGeneratorUtils.cs
r15275 r15289 28 28 ? customExpressions.Values.ElementAt(index - enabledExpressionCount) 29 29 : MapToExpression(index, random, ercOptions, config); 30 } 31 32 internal static Expression MapToExpression( 33 int index, 34 IReadOnlyExpressionsConfiguration config) { 35 36 switch (index) { 37 case PushSolutionEncoding.Noop: 38 return Noop; 39 } 40 41 var name = config.EnabledExpressions[index]; 42 return ExpressionTable.GetExpression(name); 30 43 } 31 44 … … 76 89 instructions.InExpressionCount > 0) { 77 90 78 var nr = random.Next(0, instructions.InExpressionCount) + 1;79 expression = ExpressionTable.InExpressionTable[ nr];91 var index = random.Next(0, instructions.InExpressionCount); 92 expression = ExpressionTable.InExpressionTable[index]; 80 93 } else { 81 94 expression = GetRandomExpression(random, instructions);
Note: See TracChangeset
for help on using the changeset viewer.