/** * A vehicle can have a dest and have remaining service time. */ public void validateInputsValidDestinations1() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {4, 2}}, // servicePairs new int[6], // serviceTimes new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // vehicleTravelTimes new int[][] {{1, 3}, {1, 1}}, // inventories new int[] {300, 0}, // remainingServiceTimes new int[] {4, 0}// current destinations , null); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidTravelTimeMatrix2() { validateInputs(new int[][] {new int[3], new int[3], new int[4]}, new int[] {}, new int[] {}, new int[][] {}, new int[] {}); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidPairLocation2() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] { new int[] {1, 2}, new int[] {3, 913}}, new int[6]); }
@Test(expected = IllegalArgumentException.class) public void validateInputsDuplicatePairLocation() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] { new int[] {1, 2}, new int[] {2, 0}}, new int[6]); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidTWstart2() { validateInputs(new int[3][3], new int[] {0, 2, 3}, new int[] {1, 3, 6}, new int[][] {}, new int[3]); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidPairSize() { validateInputs(new int[4][4], new int[4], new int[4], new int[][] { new int[] {1, 2}, new int[3]}, new int[4]); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidInventories6() { // reference to still available location in inventory validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {3, 1}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{1, 1}, {1, 1}}, new int[2], new int[2], null); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidInventories7() { // duplicate inventory entry validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {4, 2}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{1, 1}, {1, 1}}, new int[2], new int[2], null); }
/** * Dest array length should equal v. */ @Test(expected = IllegalArgumentException.class) public void validateInputsInvalidDestinations1() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {4, 2}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{1, 1}, {1, 3}}, new int[] {300, 0}, new int[1], null); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidTWstart1() { validateInputs(new int[3][3], new int[] {1, 2, 3}, new int[] {1, 3, 6}, new int[][] {}, new int[3]); }
/** * Negative travel time. */ @Test(expected = IllegalArgumentException.class) public void validateInputsInvalidVehicleTravelTimes2() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] { new int[] {4, 2}, new int[] {3, 1}}, new int[6], // // vehicle travel times, with one invalid travel time (-1) new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, -1, 0}}, // new int[0][0], new int[2], new int[2], null); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidInventories2() { // inventory too small validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {3, 1}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{0}}, new int[2], new int[2], null); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidInventories3() { // invalid inventory dimensions validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {3, 1}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{0}, {0}}, new int[2], new int[2], null); }
/** * Can not have the depot as dest. */ @Test(expected = IllegalArgumentException.class) public void validateInputsInvalidDestinations2a() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {4, 2}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{1, 1}, {1, 3}}, new int[] {300, 0}, new int[] { 5, 3}, null); }
@Test public void validateInputsValidMulti() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {4, 2}}, new int[6], // new int[][] {{0, MI, MI, MI, 0, MI}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{1, 1}, {1, 3}}, new int[] {300, 0}, // new int[] {4, 0}, // current destinations null); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidDueDatesLength() { validateInputs(new int[4][4], new int[4], new int[2], new int[][] {}, new int[] {}); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidServiceTime() { validateInputs(new int[7][7], new int[7], new int[7], new int[][] {}, new int[3]); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidPairLocation1() { validateInputs(new int[6][6], new int[6], new int[6], new int[][] { new int[] {1, 2}, new int[] {3, 0}}, new int[6]); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidInventories4a() { // non existing vehicle validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {3, 1}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{2, 0}, {2, 0}}, new int[2], new int[2], null); }
@Test(expected = IllegalArgumentException.class) public void validateInputsInvalidRemainingServiceTimes2() { // incorrect time value validateInputs(new int[6][6], new int[6], new int[6], new int[][] {new int[] {4, 2}}, new int[6], // new int[][] {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, // new int[][] {{1, 1}, {1, 3}}, new int[] {300, -1}, new int[2], null); }