Changeset 14121 for trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions.MultiObjective-3.3/HyperVolumeTests.cs
- Timestamp:
- 07/19/16 18:24:53 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions.MultiObjective-3.3
- Files:
-
- 1 added
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions.MultiObjective-3.3/HyperVolumeTests.cs
r14111 r14121 20 20 #endregion 21 21 using System; 22 using HeuristicLab.Problems.TestFunctions.MultiObjective;23 22 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 23 25 namespace MultiObjectiveTestfunctionTests {24 namespace HeuristicLab.Problems.TestFunctions.MultiObjective.Tests { 26 25 [TestClass] 27 26 public class HypervolumeTest { … … 40 39 /// </summary> 41 40 [TestMethod] 42 [TestCategory("Problems.TestFunctions ")]43 [TestProperty("Time", "short")] 44 public void SinglePointTest() {41 [TestCategory("Problems.TestFunctions.MultiObjective")] 42 [TestProperty("Time", "short")] 43 public void HypervolumeTestSinglePoint() { 45 44 46 45 //Front with a single Point … … 97 96 /// </summary> 98 97 [TestMethod] 99 [TestCategory("Problems.TestFunctions ")]100 [TestProperty("Time", "short")] 101 public void RandomSinglePointTest() {102 //Front with a single Point 103 double[] point = new double[2]; 104 Random r = newRandom();98 [TestCategory("Problems.TestFunctions.MultiObjective")] 99 [TestProperty("Time", "short")] 100 public void HypervolumeTestRandomSinglePoint() { 101 //Front with a single Point 102 double[] point = new double[2]; 103 var r = new System.Random(); 105 104 106 105 point[0] = r.NextDouble(); … … 150 149 /// </summary> 151 150 [TestMethod] 152 [TestCategory("Problems.TestFunctions ")]153 [TestProperty("Time", "short")] 154 public void DiagonalPointTest() {151 [TestCategory("Problems.TestFunctions.MultiObjective")] 152 [TestProperty("Time", "short")] 153 public void HypervolumeTestDiagonalPoint() { 155 154 //Front with three points 156 155 double[] point1 = new double[2]; … … 200 199 [TestMethod()] 201 200 [ExpectedException(typeof(ArgumentException))] 202 [TestCategory("Problems.TestFunctions ")]203 [TestProperty("Time", "short")] 204 public void ReferencePointViolationNE() {205 //Front with a single Point 206 double[] point = new double[2]; 207 point[0] = 0.5; 208 point[1] = 0.5; 209 double[][] front = { point }; 210 211 double[] referencePoint = new double[2]; 212 bool[] maximization; 213 214 //Northeast 215 maximization = new bool[] { true, true }; 216 referencePoint[0] = 1; 217 referencePoint[1] = 1; 218 double ne = Hypervolume.Calculate(front, referencePoint, maximization); 219 } 220 221 [TestMethod()] 222 [ExpectedException(typeof(ArgumentException))] 223 [TestCategory("Problems.TestFunctions ")]224 [TestProperty("Time", "short")] 225 public void ReferencePointViolationNW() {201 [TestCategory("Problems.TestFunctions.MultiObjective")] 202 [TestProperty("Time", "short")] 203 public void HypervolumeTestReferencePointViolationNE() { 204 //Front with a single Point 205 double[] point = new double[2]; 206 point[0] = 0.5; 207 point[1] = 0.5; 208 double[][] front = { point }; 209 210 double[] referencePoint = new double[2]; 211 bool[] maximization; 212 213 //Northeast 214 maximization = new bool[] { true, true }; 215 referencePoint[0] = 1; 216 referencePoint[1] = 1; 217 double ne = Hypervolume.Calculate(front, referencePoint, maximization); 218 } 219 220 [TestMethod()] 221 [ExpectedException(typeof(ArgumentException))] 222 [TestCategory("Problems.TestFunctions.MultiObjective")] 223 [TestProperty("Time", "short")] 224 public void HypervolumeTestReferencePointViolationNW() { 226 225 //Front with a single Point 227 226 double[] point = new double[2]; … … 243 242 [TestMethod()] 244 243 [ExpectedException(typeof(ArgumentException))] 245 [TestCategory("Problems.TestFunctions ")]246 [TestProperty("Time", "short")] 247 public void ReferencePointViolationSW() {244 [TestCategory("Problems.TestFunctions.MultiObjective")] 245 [TestProperty("Time", "short")] 246 public void HypervolumeTestReferencePointViolationSW() { 248 247 //Front with a single Point 249 248 double[] point = new double[2]; … … 265 264 [TestMethod()] 266 265 [ExpectedException(typeof(ArgumentException))] 267 [TestCategory("Problems.TestFunctions ")]268 [TestProperty("Time", "short")] 269 public void ReferencePointViolationSE() {266 [TestCategory("Problems.TestFunctions.MultiObjective")] 267 [TestProperty("Time", "short")] 268 public void HypervolumeTestReferencePointViolationSE() { 270 269 //Front with a single Point 271 270 double[] point = new double[2]; … … 284 283 Assert.AreEqual(0.25, se); 285 284 } 286 287 285 } 288 289 290 286 }
Note: See TracChangeset
for help on using the changeset viewer.