- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 10 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 8088,8092,8121,8123,8132,8154,8164,8195,8222,8309,8323
- Property svn:mergeinfo changed
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab-3.3/CollectObjectGraphTest.cs
r7259 r8331 59 59 TestContext.WriteLine("Time elapsed {0}", watch.Elapsed); 60 60 TestContext.WriteLine("Objects discovered: {0}", objects.Count()); 61 TestContext.WriteLine("HL objects discovered: {0}", objects. Where(o => o.GetType().Namespace.StartsWith("HeuristicLab")).Count());61 TestContext.WriteLine("HL objects discovered: {0}", objects.Count(o => o.GetType().Namespace.StartsWith("HeuristicLab"))); 62 62 TestContext.WriteLine(""); 63 63 … … 70 70 71 71 foreach (string s in objects.Select(o => o.GetType().Namespace).Distinct().OrderBy(s => s)) { 72 TestContext.WriteLine("{0}: {1}", s, objects. Where(o => o.GetType().Namespace == s).Count());72 TestContext.WriteLine("{0}: {1}", s, objects.Count(o => o.GetType().Namespace == s)); 73 73 } 74 74 TestContext.WriteLine(""); -
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab-3.3/PluginDependenciesTest.cs
r8086 r8331 35 35 private static Dictionary<string, string> pluginNames; 36 36 private static Dictionary<string, Assembly> pluginFilesToPluginLookup = new Dictionary<string, Assembly>(); 37 //private static Dictionary<string, string> pluginToPluginFilesLookup = new Dictionary<string, string>();38 37 39 38 // Use ClassInitialize to run code before running the first test in the class … … 91 90 92 91 var referencedNonPluginAssemblies = pluginAssembly.GetReferencedAssemblies().Where(a => !IsPluginAssemblyName(a)); 93 bool found = (from referencedNonPluginAssembl iein referencedNonPluginAssemblies94 select referencedNonPluginAssembl ie.Name into assemblyName92 bool found = (from referencedNonPluginAssembly in referencedNonPluginAssemblies 93 select referencedNonPluginAssembly.Name into assemblyName 95 94 where pluginFilesToPluginLookup.ContainsKey(assemblyName) 96 95 select GetPluginFromAssembly(pluginFilesToPluginLookup[assemblyName]) into pluginType -
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab-3.3/SamplesTest.cs
r8086 r8331 44 44 using HeuristicLab.Problems.DataAnalysis.Symbolic.Classification; 45 45 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 46 using HeuristicLab.Problems.Instances; 46 47 using HeuristicLab.Problems.Instances.DataAnalysis; 47 48 using HeuristicLab.Problems.Instances.TSPLIB; 49 using HeuristicLab.Problems.Instances.VehicleRouting; 48 50 using HeuristicLab.Problems.Knapsack; 49 51 using HeuristicLab.Problems.TestFunctions; … … 51 53 using HeuristicLab.Problems.VehicleRouting; 52 54 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 53 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;54 55 using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin; 55 56 using HeuristicLab.Problems.VehicleRouting.ProblemInstances; 56 57 using HeuristicLab.Selection; 57 58 using Microsoft.VisualStudio.TestTools.UnitTesting; 58 using HeuristicLab.Problems.Instances.VehicleRouting;59 using HeuristicLab.Problems.Instances;60 59 61 60 … … 133 132 134 133 SolomonFormatInstanceProvider instanceProvider = new SolomonInstanceProvider(); 135 IVRPData data = instanceProvider. LoadData("C101.txt", "C101.opt.txt");134 IVRPData data = instanceProvider.Import("C101.txt", "C101.opt.txt"); 136 135 vrpProblem.Load(data); 137 136 vrpProblem.Name = "C101 VRP (imported from Solomon)"; … … 439 438 } 440 439 #endregion 440 #region LawnMower 441 [TestMethod] 442 public void RunGpLawnMowerSampleTest() { 443 var ga = CreateGpLawnMowerSample(); 444 ga.SetSeedRandomly.Value = false; 445 RunAlgorithm(ga); 446 } 447 448 public GeneticAlgorithm CreateGpLawnMowerSample() { 449 GeneticAlgorithm ga = new GeneticAlgorithm(); 450 #region Problem Configuration 451 var problem = new HeuristicLab.Problems.LawnMower.Problem(); 452 #endregion 453 #region Algorithm Configuration 454 ga.Name = "Genetic Programming - Lawn Mower"; 455 ga.Description = "A standard genetic programming algorithm to solve the lawn mower problem"; 456 ga.Problem = problem; 457 ConfigureGeneticAlgorithmParameters<TournamentSelector, SubtreeCrossover, MultiSymbolicExpressionTreeArchitectureManipulator>( 458 ga, 1000, 1, 50, 0.25, 5); 459 var mutator = (MultiSymbolicExpressionTreeArchitectureManipulator)ga.Mutator; 460 mutator.Operators.SetItemCheckedState(mutator.Operators 461 .OfType<OnePointShaker>() 462 .Single(), false); 463 #endregion 464 return ga; 465 } 466 #endregion 441 467 #endregion 442 468 -
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab-3.3/ToStringTest.cs
r7532 r8331 20 20 #endregion 21 21 22 using System; 22 23 using System.Linq; 23 24 using HeuristicLab.Core; … … 29 30 public class ToStringTest { 30 31 32 private TestContext testContextInstance; 33 /// <summary> 34 ///Gets or sets the test context which provides 35 ///information about and functionality for the current test run. 36 ///</summary> 37 public TestContext TestContext { 38 get { 39 return testContextInstance; 40 } 41 set { 42 testContextInstance = value; 43 } 44 } 45 31 46 // Use ClassInitialize to run code before running the first test in the class 32 47 [ClassInitialize] … … 37 52 [TestMethod] 38 53 public void TestToString() { 54 bool success = true; 39 55 // just test for all IItems that the ToString method doesn't throw an exception 40 56 foreach (object item in ApplicationManager.Manager.GetInstances(typeof(IItem))) { 41 item.ToString(); 57 try { 58 item.ToString(); 59 } 60 catch (Exception e) { 61 TestContext.WriteLine(item.GetType() + " throws a " + e.GetType() + " in the ToString method."); 62 success = false; 63 } 42 64 } 65 Assert.IsTrue(success, "There are potential errors in the ToString methods of objects."); 43 66 } 44 67 } -
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r8086 r8331 365 365 Evaluate(interpreter, ds, "(lag -1.0 (* (lagVariable 1.0 a 1) (lagVariable 1.0 b 2)))", 1, ds.GetDoubleValue("A", 1) * ds.GetDoubleValue("B", 2)); 366 366 Evaluate(interpreter, ds, "(lag -2.0 3.0)", 1, 3.0); 367 368 { 369 // special functions 370 Action<double> checkAiry = (x) => { 371 double ai, aip, bi, bip; 372 alglib.airy(x, out ai, out aip, out bi, out bip); 373 Evaluate(interpreter, ds, "(airya " + x + ")", 0, ai); 374 Evaluate(interpreter, ds, "(airyb " + x + ")", 0, bi); 375 }; 376 377 Action<double> checkBessel = (x) => { 378 Evaluate(interpreter, ds, "(bessel " + x + ")", 0, alglib.besseli0(x)); 379 }; 380 381 Action<double> checkSinCosIntegrals = (x) => { 382 double si, ci; 383 alglib.sinecosineintegrals(x, out si, out ci); 384 Evaluate(interpreter, ds, "(cosint " + x + ")", 0, ci); 385 Evaluate(interpreter, ds, "(sinint " + x + ")", 0, si); 386 }; 387 Action<double> checkHypSinCosIntegrals = (x) => { 388 double shi, chi; 389 alglib.hyperbolicsinecosineintegrals(x, out shi, out chi); 390 Evaluate(interpreter, ds, "(hypcosint " + x + ")", 0, chi); 391 Evaluate(interpreter, ds, "(hypsinint " + x + ")", 0, shi); 392 }; 393 Action<double> checkFresnelSinCosIntegrals = (x) => { 394 double c = 0, s = 0; 395 alglib.fresnelintegral(x, ref c, ref s); 396 Evaluate(interpreter, ds, "(fresnelcosint " + x + ")", 0, c); 397 Evaluate(interpreter, ds, "(fresnelsinint " + x + ")", 0, s); 398 }; 399 Action<double> checkNormErf = (x) => { 400 Evaluate(interpreter, ds, "(norm " + x + ")", 0, alglib.normaldistribution(x)); 401 Evaluate(interpreter, ds, "(erf " + x + ")", 0, alglib.errorfunction(x)); 402 }; 403 404 Action<double> checkGamma = (x) => { 405 Evaluate(interpreter, ds, "(gamma " + x + ")", 0, alglib.gammafunction(x)); 406 }; 407 Action<double> checkPsi = (x) => { 408 try { 409 Evaluate(interpreter, ds, "(psi " + x + ")", 0, alglib.psi(x)); 410 } 411 catch (alglib.alglibexception) { // ignore cases where alglib throws an exception 412 } 413 }; 414 Action<double> checkDawson = (x) => { 415 Evaluate(interpreter, ds, "(dawson " + x + ")", 0, alglib.dawsonintegral(x)); 416 }; 417 Action<double> checkExpInt = (x) => { 418 Evaluate(interpreter, ds, "(expint " + x + ")", 0, alglib.exponentialintegralei(x)); 419 }; 420 421 422 423 foreach (var e in new[] { -2.0, -1.0, 0.0, 1.0, 2.0 }) { 424 checkAiry(e); 425 checkBessel(e); 426 checkSinCosIntegrals(e); 427 checkGamma(e); 428 checkExpInt(e); 429 checkDawson(e); 430 checkPsi(e); 431 checkNormErf(e); 432 checkFresnelSinCosIntegrals(e); 433 checkHypSinCosIntegrals(e); 434 } 435 } 367 436 } 368 437 -
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicExpressionImporter.cs
r8086 r8331 49 49 {"COS", new Cosine()}, 50 50 {"TAN", new Tangent()}, 51 {"AIRYA", new AiryA()}, 52 {"AIRYB", new AiryB()}, 53 {"BESSEL", new Bessel()}, 54 {"COSINT", new CosineIntegral()}, 55 {"SININT", new SineIntegral()}, 56 {"HYPCOSINT", new HyperbolicCosineIntegral()}, 57 {"HYPSININT", new HyperbolicSineIntegral()}, 58 {"FRESNELSININT", new FresnelSineIntegral()}, 59 {"FRESNELCOSINT", new FresnelCosineIntegral()}, 60 {"NORM", new Norm()}, 61 {"ERF", new Erf()}, 62 {"GAMMA", new Gamma()}, 63 {"PSI", new Psi()}, 64 {"DAWSON", new Dawson()}, 65 {"EXPINT", new ExponentialIntegralEi()}, 51 66 {"MEAN", new Average()}, 52 67 {"IF", new IfThenElse()}, -
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab.Problems.QuadraticAssignment-3.3/QAPLIBInstancesTest.cs
r8086 r8331 168 168 { "wil100", 273038 } 169 169 }; 170 private static Dictionary<string, double> lowerBounds = new Dictionary<string, double>() { 171 { "bur26a", 5315200 }, 172 { "bur26f", 3706888 }, 173 { "chr25a", 2765 }, 174 { "els19", 11971949 }, 175 { "esc32a", 35 }, 176 { "esc32e", 0 }, 177 { "had20", 6166 }, 178 { "kra32", 67390 }, 179 { "lipa50a", 62020 }, 180 { "lipa50b", 1210244 }, 181 { "nug30", 4539 }, 182 { "scr20", 86766 }, 183 { "sko42", 11311 }, 184 { "tai35a", 1951207 }, 185 { "tai35b", 30866283 }, 186 { "tai100a", 15824355 } 187 }; 170 188 #endregion 171 189 … … 204 222 failedInstances.AppendLine(instance.Name + ": " + qap.BestKnownQuality.Value.ToString() + " vs " + qaplibInstances[instance.Name]); 205 223 } 206 Assert.IsTrue(failedInstances.Length == 0, "Following instances/solutions have suspicious quality: " + Environment.NewLine + failedInstances.ToString()); 224 Assert.IsTrue(failedInstances.Length == 0, "Following instances/solutions have suspicious best quality: " + Environment.NewLine + failedInstances.ToString()); 225 } 226 227 [TestMethod] 228 public void TestQAPLIBLowerBounds() { 229 var provider = new QAPLIBInstanceProvider(); 230 var qap = new QuadraticAssignmentProblem(); 231 var failedInstances = new StringBuilder(); 232 233 var instances = provider.GetDataDescriptors(); 234 Assert.IsTrue(instances.Any(), "No instances could be found."); 235 236 foreach (var instance in instances) { 237 if (lowerBounds.ContainsKey(instance.Name)) { 238 qap.Load(provider.LoadData(instance)); 239 if (qap.LowerBound.Value != lowerBounds[instance.Name]) 240 failedInstances.AppendLine(instance.Name + ": The Gilmore-Lawler lower bound is not valid."); 241 } 242 } 243 Assert.IsTrue(failedInstances.Length == 0, "Following instances failed for the GLB calculation: " + Environment.NewLine + failedInstances.ToString()); 207 244 } 208 245 } -
branches/ScatterSearch (trunk integration)/HeuristicLab.Tests/HeuristicLab.Tests.csproj
r8086 r8331 20 20 <DebugType>full</DebugType> 21 21 <Optimize>false</Optimize> 22 <OutputPath>bin\ Debug\</OutputPath>22 <OutputPath>bin\</OutputPath> 23 23 <DefineConstants>DEBUG;TRACE</DefineConstants> 24 24 <ErrorReport>prompt</ErrorReport> … … 28 28 <DebugType>pdbonly</DebugType> 29 29 <Optimize>true</Optimize> 30 <OutputPath>bin\ Release\</OutputPath>30 <OutputPath>bin\</OutputPath> 31 31 <DefineConstants>TRACE</DefineConstants> 32 32 <ErrorReport>prompt</ErrorReport> … … 41 41 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> 42 42 <DebugSymbols>true</DebugSymbols> 43 <OutputPath>bin\ x64\Debug\</OutputPath>43 <OutputPath>bin\</OutputPath> 44 44 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 45 <DebugType>full</DebugType> … … 56 56 </PropertyGroup> 57 57 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> 58 <OutputPath>bin\ x64\Release\</OutputPath>58 <OutputPath>bin\</OutputPath> 59 59 <DefineConstants>TRACE</DefineConstants> 60 60 <Optimize>true</Optimize> … … 73 73 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> 74 74 <DebugSymbols>true</DebugSymbols> 75 <OutputPath>bin\ x86\Debug\</OutputPath>75 <OutputPath>bin\</OutputPath> 76 76 <DefineConstants>DEBUG;TRACE</DefineConstants> 77 77 <DebugType>full</DebugType> … … 88 88 </PropertyGroup> 89 89 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> 90 <OutputPath>bin\ x86\Release\</OutputPath>90 <OutputPath>bin\</OutputPath> 91 91 <DefineConstants>TRACE</DefineConstants> 92 92 <Optimize>true</Optimize> … … 228 228 <Reference Include="HeuristicLab.Problems.Knapsack-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 229 229 <HintPath>..\bin\HeuristicLab.Problems.Knapsack-3.3.dll</HintPath> 230 </Reference> 231 <Reference Include="HeuristicLab.Problems.LawnMower-3.3"> 232 <HintPath>..\bin\HeuristicLab.Problems.LawnMower-3.3.dll</HintPath> 230 233 </Reference> 231 234 <Reference Include="HeuristicLab.Problems.LinearAssignment-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> … … 279 282 <Compile Include="HeuristicLab-3.3\CollectObjectGraphTest.cs" /> 280 283 <Compile Include="HeuristicLab-3.3\ContentViewTests.cs" /> 284 <Compile Include="HeuristicLab-3.3\ParameterVisibilityTest.cs" /> 285 <Compile Include="HeuristicLab-3.3\GaussianProcessRegressionTest.cs" /> 281 286 <Compile Include="HeuristicLab-3.3\DeepCloneableCloningTest.cs" /> 282 287 <Compile Include="HeuristicLab-3.3\GeneticAlgorithmTest.cs" />
Note: See TracChangeset
for help on using the changeset viewer.