Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 * Fixed test for SBX after changing SBX in r3172

git-svn-id: https://src.heuristiclab.com/svn/core/trunk@4872 2abd9481-f8db-48e9-bd25-06bc13291c1b
  • Loading branch information
abeham committed Nov 20, 2010
1 parent 050d364 commit 20676c3
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ public void SimulatedBinaryCrossoverCrossTest() {
try {
RealVector actual;
actual = target.Cross(random, parents);
}
catch (System.ArgumentException) {
} catch (System.ArgumentException) {
exceptionFired = true;
}
Assert.IsTrue(exceptionFired);
Expand All @@ -109,8 +108,7 @@ public void SimulatedBinaryCrossoverCrossTest() {
try {
RealVector actual;
actual = target.Cross(random, parents);
}
catch (System.ArgumentException) {
} catch (System.ArgumentException) {
exceptionFired = true;
}
Assert.IsTrue(exceptionFired);
Expand All @@ -131,7 +129,7 @@ public void SimulatedBinaryCrossoverApplyTest() {
contiguity = new DoubleValue(0.3);
parent1 = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });
parent2 = new RealVector(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 });
expected = new RealVector(new double[] { 1.11032829834638, -0.0145477755417797, 0.3, 0.5, 0.1 });
expected = new RealVector(new double[] { 0.644880972204315, 0.0488239539275703, 0.3, 0.5, 0.1 });
actual = SimulatedBinaryCrossover.Apply(random, parent1, parent2, contiguity);
Assert.IsTrue(Auxiliary.RealVectorIsAlmostEqualByPosition(actual, expected));
// The following test is not based on published examples
Expand All @@ -143,8 +141,7 @@ public void SimulatedBinaryCrossoverApplyTest() {
exceptionFired = false;
try {
actual = SimulatedBinaryCrossover.Apply(random, parent1, parent2, contiguity);
}
catch (System.ArgumentException) {
} catch (System.ArgumentException) {
exceptionFired = true;
}
Assert.IsTrue(exceptionFired);
Expand All @@ -157,8 +154,7 @@ public void SimulatedBinaryCrossoverApplyTest() {
exceptionFired = false;
try {
actual = SimulatedBinaryCrossover.Apply(random, parent1, parent2, contiguity);
}
catch (System.ArgumentException) {
} catch (System.ArgumentException) {
exceptionFired = true;
}
Assert.IsTrue(exceptionFired);
Expand Down

0 comments on commit 20676c3

Please sign in to comment.