- Timestamp:
- 12/29/17 23:56:43 (7 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.