Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/10/17 11:23:05 (8 years ago)
Author:
pkimmesw
Message:

#2665 Added IsNoop to Expression, Made Expressions storable, Fixed Debugger, Fixed and improved problem data and result visualisation, Added custom ErcOption view, Added problem difficulty to problem data name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Interpreter/InterpreterPoolContainer.cs

    r14875 r14952  
    6767
    6868    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) {
    7370        statefulExpressionPoolProviders.Add(type, new ManagedPoolProvider<Expression>(
    7471          partitionSize,
    75           ExpressionTable.StatefulExpressionFactory[name],
     72          ExpressionTable.StatefulExpressionFactory[type],
    7673          maxPartitionCount));
    7774
     
    8683
    8784      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());
    8890    }
    8991
Note: See TracChangeset for help on using the changeset viewer.