Changeset 14952 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/InterpreterPoolContainer.cs
- Timestamp:
- 05/10/17 11:23:05 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/InterpreterPoolContainer.cs
r14875 r14952 67 67 68 68 private void InitStatefulExpressionPools(int partitionSize, int maxPartitionCount) { 69 for (var i = 0; i < ExpressionTable.StatefulExpressionTypes.Count; i++) { 70 var type = ExpressionTable.StatefulExpressionTypes[i]; 71 var name = ExpressionTable.TypeToNameTable[type]; 72 69 foreach (var type in ExpressionTable.StatefulExpressionTypes) { 73 70 statefulExpressionPoolProviders.Add(type, new ManagedPoolProvider<Expression>( 74 71 partitionSize, 75 ExpressionTable.StatefulExpressionFactory[ name],72 ExpressionTable.StatefulExpressionFactory[type], 76 73 maxPartitionCount)); 77 74 … … 86 83 87 84 return (T)statefulExpressionPools[type].Get(); 85 } 86 87 public IManagedPool<Expression> GetStatefulExpressionPool<T>() where T : Expression { 88 var type = typeof(T); 89 return statefulExpressionPools[type] ?? (statefulExpressionPools[type] = statefulExpressionPoolProviders[type].CreatePool()); 88 90 } 89 91
Note: See TracChangeset
for help on using the changeset viewer.