Changeset 15562 for branches/GeneralizedQAP/UnitTests
- Timestamp:
- 12/29/17 23:56:43 (7 years ago)
- Location:
- branches/GeneralizedQAP/UnitTests
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/UnitTests/ApproximateLocalSearchTest.cs
r15558 r15562 13 13 [TestMethod] 14 14 public void ApproximateLocalSearchApplyTest() { 15 CollectionAssert.AreEqual(new [] { 3, 2, 1, 1, 3, 0, 1, 0, 3, 0 }, assignment.ToArray());15 CollectionAssert.AreEqual(new [] { 2, 0, 1, 1, 2, 3, 0, 3, 0, 0 }, assignment.ToArray()); 16 16 17 17 var evaluation = instance.Evaluate(assignment); 18 Assert.AreEqual( 4091776, evaluation.FlowCosts);19 Assert.AreEqual( 42, evaluation.InstallationCosts);18 Assert.AreEqual(3985258, evaluation.FlowCosts); 19 Assert.AreEqual(30, evaluation.InstallationCosts); 20 20 Assert.AreEqual(0, evaluation.ExcessDemand); 21 21 22 22 var quality = instance.ToSingleObjective(evaluation); 23 Assert.AreEqual(15 903846.056964701, quality, 1e-9);23 Assert.AreEqual(15489822.781533258, quality, 1e-9); 24 24 25 25 var evaluatedSolutions = 0; 26 26 ApproximateLocalSearch.Apply(random, assignment, ref quality, 27 ref evaluation, 10, 0.5, 100 0, instance,27 ref evaluation, 10, 0.5, 100, instance, 28 28 out evaluatedSolutions); 29 Assert.AreEqual(6 80, evaluatedSolutions);30 CollectionAssert.AreEqual(new[] { 3, 1, 0, 3, 0, 0, 1, 2, 3, 0 }, assignment.ToArray());31 Assert.AreEqual(1 2440163.936988469, quality, 1e-9);29 Assert.AreEqual(61, evaluatedSolutions); 30 CollectionAssert.AreEqual(new[] { 2, 0, 0, 0, 2, 1, 0, 3, 0, 0 }, assignment.ToArray()); 31 Assert.AreEqual(10167912.633734789, quality, 1e-9); 32 32 } 33 33 -
branches/GeneralizedQAP/UnitTests/UnitTests.csproj
r15512 r15562 110 110 <Compile Include="Properties\AssemblyInfo.cs" /> 111 111 <Compile Include="ApproximateLocalSearchTest.cs" /> 112 <Compile Include="GRASPTest.cs" /> 112 113 </ItemGroup> 113 114 <ItemGroup> … … 115 116 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 116 117 <Name>HeuristicLab.Optimization-3.3</Name> 118 </ProjectReference> 119 <ProjectReference Include="..\HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms\3.3\HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms-3.3.csproj"> 120 <Project>{577239EC-7D7F-4505-A0A4-572E34010DBA}</Project> 121 <Name>HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms-3.3</Name> 117 122 </ProjectReference> 118 123 <ProjectReference Include="..\HeuristicLab.Problems.GeneralizedQuadraticAssignment\3.3\HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj">
Note: See TracChangeset
for help on using the changeset viewer.