Changeset 14747 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests
- Timestamp:
- 03/12/17 13:16:56 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Tests/Benchmark/ProblemTests.cs
r14746 r14747 9 9 using HeuristicLab.Problems.Instances; 10 10 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 11 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool;12 11 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 13 12 using HeuristicLab.Problems.ProgramSynthesis.Push.Generators; … … 147 146 var instance = new BenchmarkSuiteInstanceProvider(); 148 147 var data = instance.LoadData(descriptor); 149 var provider = new ManagedPoolProvider<PushProgram>(1024);150 provider.InitDummyPartition(() => new PushProgram());151 148 152 149 Parallel.For(0, iterations, i => { 153 150 var execCounter = 0; 154 155 var pushProgramPool = provider.CreatePool();156 var program = CodeGenerator.RandomProgram(pushProgramPool, maxProgramSizeLimit, random);157 158 151 var results = new double[data.OriginalTrainingCount]; 152 PushProgram program; 159 153 160 154 using (var interpreter = pool.GetInstance(random)) { 161 interpreter.PushProgramPool = pushProgramPool;155 program = CodeGenerator.RandomProgram(interpreter.PushProgramPool, maxProgramSizeLimit, random); 162 156 163 157 for (var j = 0; j < data.OriginalTrainingCount; j++) { … … 169 163 170 164 interpreter.Run(program); 171 pushProgramPool.Dispose();172 165 173 166 var diff = GetDiff(example.OutputInt, interpreter.IntegerStack) … … 179 172 execCounter += interpreter.ExecCounter; 180 173 interpreter.Clear(); 181 pushProgramPool = provider.CreatePool();182 174 } 183 175 }
Note: See TracChangeset
for help on using the changeset viewer.