Changeset 15490 for branches/GeneralizedQAP/UnitTests
- Timestamp:
- 12/04/17 23:00:03 (7 years ago)
- Location:
- branches/GeneralizedQAP
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP
- Property svn:ignore
-
old new 2 2 TestResults 3 3 *.user 4 .vs
-
- Property svn:ignore
-
branches/GeneralizedQAP/UnitTests/CordeauCrossoverTest.cs
r7970 r15490 21 21 22 22 using System.Linq; 23 using System.Threading; 23 24 using HeuristicLab.Data; 24 using HeuristicLab.Encodings.IntegerVectorEncoding;25 25 using HeuristicLab.Problems.GeneralizedQuadraticAssignment; 26 26 using HeuristicLab.Problems.Instances.CordeauGQAP; … … 34 34 public void CordeauCrossoverFunctionalityTest() { 35 35 var provider = new CordeauGQAPInstanceProvider(); 36 var instance = provider.LoadData(provider.GetDataDescriptors(). First());36 var instance = provider.LoadData(provider.GetDataDescriptors().Single(x => x.Name == "20-15-75")); 37 37 var gqap = new GeneralizedQuadraticAssignmentProblem(); 38 38 gqap.Load(instance); 39 var evaluator = gqap.Evaluator; 39 40 40 var random = new MersenneTwister();41 41 for (int i = 0; i < 100; i++) { 42 var parent1 = new IntegerVector(gqap.Demands.Length, random, 0, gqap.Capacities.Length); 43 var parent2 = new IntegerVector(gqap.Demands.Length, random, 0, gqap.Capacities.Length); 42 var random = new MersenneTwister((uint)i); 43 var parent1 = GreedyRandomizedSolutionCreator.CreateSolution(random, gqap.Demands, gqap.Capacities, gqap.Evaluator, 100, true, CancellationToken.None); 44 var parent2 = GreedyRandomizedSolutionCreator.CreateSolution(random, gqap.Demands, gqap.Capacities, gqap.Evaluator, 100, true, CancellationToken.None); 44 45 45 46 try { … … 49 50 parent2, 50 51 new DoubleValue(gqap.Evaluator.Evaluate(parent2, gqap.Weights, gqap.Distances, gqap.InstallationCosts, gqap.Demands, gqap.Capacities, gqap.TransportationCosts, gqap.ExpectedRandomQuality)), 51 gqap.Weights, gqap.Distances, gqap.InstallationCosts, gqap.Demands, gqap.Capacities, gqap.TransportationCosts, gqap.ExpectedRandomQuality, gqap.Evaluator); 52 gqap.Weights, gqap.Distances, gqap.InstallationCosts, gqap.Demands, gqap.Capacities, gqap.TransportationCosts, gqap.ExpectedRandomQuality, gqap.Evaluator, 53 new IntValue(0)); 52 54 } catch { 53 55 Assert.Fail("Error during crossover"); -
branches/GeneralizedQAP/UnitTests/UnitTests.csproj
r13418 r15490 65 65 <Private>True</Private> 66 66 </Reference> 67 <Reference Include="HeuristicLab.Optimization-3.3">68 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>69 <Private>True</Private>70 </Reference>71 67 <Reference Include="HeuristicLab.Parameters-3.3"> 72 68 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath> … … 115 111 </ItemGroup> 116 112 <ItemGroup> 113 <ProjectReference Include="..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 114 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 115 <Name>HeuristicLab.Optimization-3.3</Name> 116 </ProjectReference> 117 117 <ProjectReference Include="..\HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common\3.3\HeuristicLab.Problems.GeneralizedQuadraticAssignment.Common-3.3.csproj"> 118 118 <Project>{DA367BE5-4F53-4243-933B-32AAB86189D5}</Project>
Note: See TracChangeset
for help on using the changeset viewer.