Changeset 6205 for trunk/sources/HeuristicLab/3.3/Tests
- Timestamp:
- 05/17/11 00:09:59 (14 years ago)
- Location:
- trunk/sources/HeuristicLab/3.3/Tests
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab/3.3/Tests/CollectObjectGraphTest.cs
r6201 r6205 24 24 using System.Diagnostics; 25 25 using System.Linq; 26 using System.Threading; 26 27 using HeuristicLab.Algorithms.GeneticAlgorithm; 27 28 using HeuristicLab.Common; 29 using HeuristicLab.Optimization; 28 30 using HeuristicLab.Persistence.Default.Xml; 31 using HeuristicLab.Problems.TestFunctions; 32 using HeuristicLab.Random; 33 using HeuristicLab.SequentialEngine; 29 34 using Microsoft.VisualStudio.TestTools.UnitTesting; 30 35 … … 82 87 TestContext.WriteLine(""); 83 88 } 89 90 [TestMethod] 91 public void AlgorithmExecutions() { 92 var random = new MersenneTwister(0); 93 var algs = new List<IAlgorithm>(); 94 95 Stopwatch sw = new Stopwatch(); 96 for (int i = 0; i < 100; i++) { 97 GeneticAlgorithm ga = new GeneticAlgorithm(); 98 ga.PopulationSize.Value = 5; 99 ga.MaximumGenerations.Value = 5; 100 ga.Engine = new SequentialEngine(); 101 ga.Problem = new SingleObjectiveTestFunctionProblem(); 102 103 sw.Start(); 104 algs.Add(ga); 105 106 var cancellationTokenSource = new CancellationTokenSource(); 107 ga.StartSync(cancellationTokenSource.Token); 108 sw.Stop(); 109 TestContext.WriteLine("{0}: {1} ", i, sw.Elapsed); 110 sw.Reset(); 111 } 112 } 84 113 } 85 114 } -
trunk/sources/HeuristicLab/3.3/Tests/HeuristicLab-3.3.Tests.csproj
r6201 r6205 122 122 </ItemGroup> 123 123 <ItemGroup> 124 <Compile Include="AlgorithmExtensions.cs" /> 124 125 <Compile Include="CloningConstructorTest.cs" /> 125 126 <Compile Include="CollectObjectGraphTest.cs" /> … … 559 560 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 560 561 </None> 562 <None Include="GA_SymbReg2.hl"> 563 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 564 </None> 561 565 </ItemGroup> 562 566 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Note: See TracChangeset
for help on using the changeset viewer.