Changeset 15289 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Individual
- 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/Individual/IndividualExtensions.cs
r15273 r15289 1 1 namespace HeuristicLab.Problems.ProgramSynthesis.Push.Individual { 2 2 using System.Collections.Generic; 3 4 using HeuristicLab.Core;5 3 using HeuristicLab.Encodings.IntegerVectorEncoding; 6 4 using HeuristicLab.Optimization; 7 5 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 8 6 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 9 using HeuristicLab.Problems.ProgramSynthesis.Push.Generators.CodeGenerator;10 7 using HeuristicLab.Problems.ProgramSynthesis.Push.SolutionCreator; 11 8 12 9 public static class IndividualExtensions { 13 10 14 public static PushProgram ToPushProgram(this Individual individual, IReadOnlyPushConfiguration config , IRandom random) {15 return individual.IntegerVector().ToPushProgram(config , random);11 public static PushProgram ToPushProgram(this Individual individual, IReadOnlyPushConfiguration config) { 12 return individual.IntegerVector().ToPushProgram(config); 16 13 } 17 14 18 public static PushProgram ToPushProgram(this IntegerVector vector, IReadOnlyPushConfiguration config , IRandom random) {15 public static PushProgram ToPushProgram(this IntegerVector vector, IReadOnlyPushConfiguration config) { 19 16 //var currentIndex = 0; 20 17 //var close = 0; … … 24 21 var index = vector[i]; 25 22 26 if (index == PushSolutionEncoding.End) 27 break;23 if (index == PushSolutionEncoding.End) break; 24 if (index == PushSolutionEncoding.Noop) continue; 28 25 29 // skip noops 30 if (index == PushSolutionEncoding.Noop) 31 continue; 26 var name = config.EnabledExpressions[index]; 27 var expression = ExpressionTable.GetExpression(name); 32 28 33 var expression = CodeGeneratorUtils.MapToExpression(34 index,35 random,36 config.ErcOptions,37 config);29 //var expression = CodeGeneratorUtils.MapToExpression( 30 // index, 31 // random, 32 // config.ErcOptions, 33 // config); 38 34 39 35 expressions.Add(expression);
Note: See TracChangeset
for help on using the changeset viewer.