Changeset 14746 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator.cs
- Timestamp:
- 03/11/17 20:07:13 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Generators/CodeGenerator.cs
r14745 r14746 5 5 using HeuristicLab.Core; 6 6 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 7 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool; 7 8 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 8 9 using HeuristicLab.Random; … … 18 19 public static class CodeGenerator { 19 20 20 public static PushProgram RandomProgram( int maxPoints, IRandom random = null, IReadonlyPushConfiguration pushGpConfiguration = null, IDictionary<string, Expression> customExpressions = null) {21 public static PushProgram RandomProgram(IManagedPool<PushProgram> pool, int maxPoints, IRandom random = null, IReadonlyPushConfiguration pushGpConfiguration = null, IDictionary<string, Expression> customExpressions = null) { 21 22 var code = RandomCode(maxPoints, random, pushGpConfiguration, customExpressions); 22 23 23 return new PushProgram(code.ToArray()); 24 } 25 26 public static PushProgram RandomExpandExpression(int maxPoints, IRandom random = null, IReadonlyPushConfiguration pushGpConfiguration = null, IDictionary<string, Expression> customExpressions = null) { 27 var program = RandomProgram(maxPoints, random, pushGpConfiguration, customExpressions); 28 29 return new PushProgram(program); 24 return PushProgram.Create(pool, code.ToArray()); 30 25 } 31 26
Note: See TracChangeset
for help on using the changeset viewer.