Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/01/17 09:28:34 (7 years ago)
Author:
pkimmesw
Message:

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

File:
1 edited

Legend:

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

    r14834 r15017  
    1111
    1212    public readonly ManagedPoolProvider<PushProgram> PushProgramPoolProvider;
    13     public readonly ManagedPoolProvider<LoopState> LoopStatePoolProvider;
    1413    public readonly ManagedPoolProvider<PooledList<Expression>> ExpressionListPoolProvider;
    1514
     
    1918
    2019    public PushInterpreterPool(int size, int poolPartitionSize, int? maxPartitionCount = null, IReadOnlyPushConfiguration config = null) {
    21       PushGpConfiguration = config ?? new PushConfiguration();
     20      PushConfiguration = config ?? new PushConfiguration();
    2221
    2322      PushProgramPoolProvider = new ManagedPoolProvider<PushProgram>(poolPartitionSize, () => new PushProgram(), maxPartitionCount);
    24       LoopStatePoolProvider = new ManagedPoolProvider<LoopState>(poolPartitionSize, () => new LoopState(), maxPartitionCount);
    25       ExpressionListPoolProvider = new ManagedPoolProvider<PooledList<Expression>>(poolPartitionSize * 2, () => new PooledList<Expression>(), maxPartitionCount);
     23      ExpressionListPoolProvider = new ManagedPoolProvider<PooledList<Expression>>(poolPartitionSize, () => new PooledList<Expression>(), maxPartitionCount);
    2624
    2725      pool = new ObjectPool<PooledPushInterpreter>(() => {
    28         var poolContainer = new InterpreterPoolContainer(PushProgramPoolProvider, LoopStatePoolProvider, ExpressionListPoolProvider);
    29         return new PooledPushInterpreter(this, PushGpConfiguration, poolContainer);
     26        var poolContainer = new InterpreterPoolContainer(PushProgramPoolProvider, ExpressionListPoolProvider);
     27        return new PooledPushInterpreter(this, PushConfiguration, poolContainer);
    3028      }, size);
    3129    }
    3230
    33     public IReadOnlyPushConfiguration PushGpConfiguration { get; private set; }
     31    public IReadOnlyPushConfiguration PushConfiguration { get; private set; }
    3432
    3533    public PooledPushInterpreter Create(IRandom random = null) {
     
    4139
    4240    public void Free(PooledPushInterpreter interpreter) {
     41      interpreter.Random = null;
    4342      pool.Free(interpreter);
     43    }
     44
     45    public void Clear() {
     46      PushProgramPoolProvider.Clear();
     47      ExpressionListPoolProvider.Clear();
    4448    }
    4549  }
Note: See TracChangeset for help on using the changeset viewer.