Merge branch 'bug3484' of ssh://trac@sapsailing.com/home/trac/git into bug3484

This commit is contained in:
Joshua Schulz committed 2017-11-16 11:20:15 +01:00
commit 393151bd3a
4 files changed
+28 -17

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
---
VM version: Oct 9 2017 15:07:17 - 81_REL - optU - windows amd64 - 6 - bas2:294982 (mixed mode)
Time:2017-11-1611:09:20
Pid: 11816
Hostname: WDFN34222622A
current dir: C:\Users\D070307\.git\.projects\git\java\com.sap.sse.test
---
: [10356] 11:09:20 ***ERROR (:0): Java assert: "expected:<1> but was:<0>" in org.junit.Assert.fail(Assert.java:91)
@@ -107,7 +107,7 @@ public class PairingListTemplateFactoryTest {
for(int i = 0; i < flights; i++) {
IntStream.range(0, competitors).forEach(competitor -> {
IntStream.range(0, competitors - 1).forEach(competitor -> {
availableCompetitors.add(competitor);
});
@@ -20,16 +20,16 @@ public class PairingListTemplateTest extends PairingListTemplateImpl {
@Test
public void testArrayCopy() {
int[][] flightColumn = { { 1, 2, 3, 4, 5, 6 }, { 7, 8, 9, 10, 11, 12 }, { 13, 14, 15, 16, 17, 18 } };
int[][] flightColumn = { { 0, 1, 2, 3, 4, 5}, { 6, 7, 8, 9, 10, 11 }, { 12, 13, 14, 15, 16, 17} };
int[][][] associationRow = new int[3][5][18];
int[][] currentAssociations = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 },
int[][] currentAssociations = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -117,21 +117,21 @@ public class PairingListTemplateTest extends PairingListTemplateImpl {
@Test
public void testStandardDevCalc() {
int[][] givenPairingList = { { 18, 15, 17, 14, 16, 8 }, { 13, 1, 10, 9, 12, 11 }, { 3, 5, 2, 4, 6, 7 },
{ 18, 13, 17, 4, 12, 7 }, { 11, 15, 16, 6, 1, 5 }, { 14, 10, 8, 2, 9, 3 }, { 15, 18, 11, 2, 13, 3 },
{ 17, 10, 14, 6, 7, 1 }, { 8, 4, 16, 5, 9, 12 }, { 7, 3, 16, 1, 9, 18 }, { 12, 15, 10, 17, 5, 2 },
{ 6, 11, 4, 13, 8, 14 }, { 16, 11, 4, 17, 3, 10 }, { 12, 2, 6, 8, 18, 1 }, { 7, 13, 5, 15, 14, 9 },
{ 1, 3, 12, 15, 14, 4 }, { 9, 17, 6, 16, 13, 2 }, { 5, 18, 7, 11, 10, 8 }, { 16, 2, 7, 11, 14, 12 },
{ 3, 1, 5, 8, 17, 13 }, { 6, 9, 4, 10, 15, 18 }, { 14, 16, 13, 10, 5, 18 }, { 11, 2, 1, 9, 4, 17 },
{ 8, 12, 3, 7, 6, 15 }, { 10, 13, 8, 7, 16, 15 }, { 2, 14, 18, 4, 5, 1 }, { 6, 17, 9, 12, 11, 3 },
{ 14, 17, 18, 12, 11, 5 }, { 15, 16, 13, 1, 4, 2 }, { 8, 6, 3, 10, 7, 9 }, { 16, 6, 12, 18, 2, 10 },
{ 1, 8, 15, 14, 17, 9 }, { 5, 7, 13, 3, 4, 11 }, { 9, 7, 18, 2, 15, 11 }, { 13, 3, 14, 1, 12, 10 },
{ 17, 4, 5, 16, 8, 6 }, { 17, 4, 12, 15, 10, 7 }, { 3, 1, 11, 18, 8, 16 }, { 2, 9, 6, 5, 13, 14 },
{ 18, 9, 17, 5, 3, 15 }, { 12, 7, 1, 13, 16, 6 }, { 10, 14, 2, 8, 11, 4 }, { 7, 14, 2, 17, 3, 16 },
{ 15, 5, 10, 11, 1, 6 }, { 4, 12, 8, 9, 18, 13 } };
int[][] givenPairingList = { { 0, 15, 17, 14, 16, 8 }, { 13, 1, 10, 9, 12, 11 }, { 3, 5, 2, 4, 6, 7 },
{ 0, 13, 17, 4, 12, 7 }, { 11, 15, 16, 6, 1, 5 }, { 14, 10, 8, 2, 9, 3 }, { 15, 0, 11, 2, 13, 3 },
{ 17, 10, 14, 6, 7, 1 }, { 8, 4, 16, 5, 9, 12 }, { 7, 3, 16, 1, 9, 0 }, { 12, 15, 10, 17, 5, 2 },
{ 6, 11, 4, 13, 8, 14 }, { 16, 11, 4, 17, 3, 10 }, { 12, 2, 6, 8, 0, 1 }, { 7, 13, 5, 15, 14, 9 },
{ 1, 3, 12, 15, 14, 4 }, { 9, 17, 6, 16, 13, 2 }, { 5, 0, 7, 11, 10, 8 }, { 16, 2, 7, 11, 14, 12 },
{ 3, 1, 5, 8, 17, 13 }, { 6, 9, 4, 10, 15, 0 }, { 14, 16, 13, 10, 5, 0 }, { 11, 2, 1, 9, 4, 17 },
{ 8, 12, 3, 7, 6, 15 }, { 10, 13, 8, 7, 16, 15 }, { 2, 14, 0, 4, 5, 1 }, { 6, 17, 9, 12, 11, 3 },
{ 14, 17, 0, 12, 11, 5 }, { 15, 16, 13, 1, 4, 2 }, { 8, 6, 3, 10, 7, 9 }, { 16, 6, 12, 0, 2, 10 },
{ 1, 8, 15, 14, 17, 9 }, { 5, 7, 13, 3, 4, 11 }, { 9, 7, 0, 2, 15, 11 }, { 13, 3, 14, 1, 12, 10 },
{ 17, 4, 5, 16, 8, 6 }, { 17, 4, 12, 15, 10, 7 }, { 3, 1, 11, 0, 8, 16 }, { 2, 9, 6, 5, 13, 14 },
{ 0, 9, 17, 5, 3, 15 }, { 12, 7, 1, 13, 16, 6 }, { 10, 14, 2, 8, 11, 4 }, { 7, 14, 2, 17, 3, 16 },
{ 15, 5, 10, 11, 1, 6 }, { 4, 12, 8, 9, 0, 13 } };
Assert.assertEquals(0.5998846486579744,
calcStandardDev(incrementAssociations(givenPairingList, new int[18][18])), 0.0);
int[][] testPairingList = { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 } };
int[][] testPairingList = { { 0, 1, 2, 3, 4 }, { 5, 6, 7, 8, 9 } };
Assert.assertEquals(0.4967673,
(calcStandardDev(incrementAssociations(testPairingList, new int[10][10]))), 0.01);
}
@@ -201,6 +201,8 @@ public class PairingListTemplateImpl implements PairingListTemplate {
this.seedLength = seedLength;
this.plt = new int[flights * groups][competitors / groups];
this.associations = new int[competitors][competitors];
//
for (int i = 0; i < constantPLT.length; i++) {
System.arraycopy(constantPLT[i], 0, this.plt[i], 0, competitors / groups);
}