Changeset 14834 for branches/PushGP/HeuristicLab.PushGP/FeatureTests
- Timestamp:
- 04/10/17 00:27:31 (8 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP/FeatureTests
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/FeatureTests/FeatureTests.csproj
r14777 r14834 40 40 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 41 41 </Reference> 42 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 43 <SpecificVersion>False</SpecificVersion> 44 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 45 </Reference> 42 46 <Reference Include="HeuristicLab.Random-3.3"> 43 47 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> … … 57 61 <Compile Include="DirtyList\PushStack3.cs" /> 58 62 <Compile Include="DirtyList\PushStack.cs" /> 59 <Compile Include="Pool\IPooledObject.cs" />60 <Compile Include="Pool\ManagedPool.cs" />61 <Compile Include="Pool\ManagedPoolProvider.cs" />62 <Compile Include="Pool\ObjectPool.cs" />63 <Compile Include="Pool\PooledList.cs" />64 63 <Compile Include="Program.cs" /> 65 64 <Compile Include="Properties\AssemblyInfo.cs" /> -
branches/PushGP/HeuristicLab.PushGP/FeatureTests/Program.cs
r14777 r14834 8 8 using System.Threading; 9 9 using DirtyList; 10 11 10 using HeuristicLab.Problems.ProgramSynthesis.Push.Configuration; 11 using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool; 12 using HeuristicLab.Problems.ProgramSynthesis.Push.Erc; 12 13 using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions; 13 using HeuristicLab.Problems.ProgramSynthesis.Push.Generators ;14 using HeuristicLab.Problems.ProgramSynthesis.Push.Generators.CodeGenerator; 14 15 using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter; 15 16 using HeuristicLab.Problems.ProgramSynthesis.Push.Parser; … … 18 19 using HeuristicLab.Random; 19 20 20 using TestPooling.Pool;21 22 21 class Program { 23 22 private const int PartitionSize = 512; … … 33 32 //Test3(); 34 33 35 //TestCollectionPooling();34 TestCollectionPooling(); 36 35 37 36 //DirtyListTest(); … … 46 45 //PerformanceParallelTestInterpreter(); 47 46 //PerformanceTestLinearCodeGenerator(); 48 TestRobustness();47 //TestRobustness(); 49 48 //TestPool(); 50 49 //TestPoolPerformance(); … … 58 57 59 58 private static void TestExpressionDependencies() { 60 var enabledExpressions = ExpressionTable.GetE nabledExpressionsByStackTypes(StackTypes.Boolean | StackTypes.Integer);59 var enabledExpressions = ExpressionTable.GetExpressionsByStackTypes(StackTypes.Boolean | StackTypes.Integer); 61 60 } 62 61 … … 234 233 235 234 Console.WriteLine("Collection Pooling - Duration: {0} - {1} for {2}/{3} instances", sw.ElapsedTicks, sw.Elapsed.TotalSeconds, provider.InstanceCount, TotalInstanceCount); 236 }237 238 239 private static void Test1() {240 var sw = new Stopwatch();241 242 sw.Start();243 Parallel.For(0, PopulationCount, pc => {244 for (var e = 0; e < ExampleCount; e++) {245 using (var pool = new ManagedPool<Person>(PartitionSize, () => new Person())) {246 for (var i = 0; i < InstanceCount; i++) {247 var person = pool.Get();248 person.Age = pc + e + i;249 person.Name = string.Format("{0} - {1} - {2}", pc, e, i);250 }251 }252 }253 });254 sw.Stop();255 256 Console.WriteLine("1 - Duration: {0} - {1} for {2}/{3} instances", sw.ElapsedTicks, sw.Elapsed.TotalSeconds, ManagedPool<Person>.InstanceCount, TotalInstanceCount);257 235 } 258 236 … … 328 306 var interpreter = new PushInterpreter(); 329 307 330 interpreter.Run Async("( 0 2 CODE.QUOTE ( 1 INTEGER.+ 0 3 CODE.QUOTE ( 1 INTEGER.+ INTEGER.* ) CODE.DO*RANGE INTEGER.+ ) CODE.DO*RANGE )", true).Wait();308 interpreter.Run("( 0 2 CODE.QUOTE ( 1 INTEGER.+ 0 3 CODE.QUOTE ( 1 INTEGER.+ INTEGER.* ) CODE.DO*RANGE INTEGER.+ ) CODE.DO*RANGE )"); 331 309 332 310 while (!interpreter.IsCompleted) { … … 399 377 var sw = new Stopwatch(); 400 378 var random = new FastRandom(1337); 401 var poolProvider = new ManagedPoolProvider<PooledList<Expression>>(65636, () => new PooledList<Expression>()); 402 403 sw.Start(); 404 var expressions = LinearCodeGenerator.RandomCode(60000000, null, random).ToList(); 379 var config = new PushConfiguration { 380 ErcOptions = { 381 ErcProbability = 0.2, 382 FloatErcOptions = new FloatErcOptions(-100.5, 100.5, 1000.5, 2000.5), 383 IntegerErcOptions = new IntegerErcOptions(-10, 10, 100, 200), 384 StringErcOptions = 385 new StringErcOptions { AllowSpace = true, SpaceProbability = 0.2 }, 386 BooleanErcOptions = new BooleanErcOptions(), 387 CharErcOptions = new CharErcOptions(Convert.ToInt32('a'), Convert.ToInt32('Z')) 388 } 389 }; 390 391 sw.Start(); 392 var expressions = LinearCodeGenerator.RandomCode(60000000, null, random, config).ToList(); 405 393 sw.Stop(); 406 394 … … 417 405 var config = new PushConfiguration { 418 406 EvalPushLimit = 1024, 419 MaxPointsInProgram = 1024, 420 IsCodeStackEnabled = false, 421 IsExecStackEnabled = false, 422 IsBooleanStackEnabled = false, 423 IsFloatStackEnabled = false, 424 IsIntegerStackEnabled = false, 425 IsNameStackEnabled = false, 407 MaxPointsInProgram = 1024 426 408 }; 427 409
Note: See TracChangeset
for help on using the changeset viewer.