target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void whenInsertingActBetweenTwoRouteActsAndRouteIsOpen_itCalcsMarginalTpCosts() { TourActivity prevAct = mock(TourActivity.class); when(prevAct.getLocation()).thenReturn(loc("i")); when(prevAct.getIndex()).thenReturn(1); TourActivity nextAct = mock(TourActivity.class); when(nextAct.getLocation()).thenRetur... | @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutStaticLocation) ((ActWithoutStaticLocation) prevAct).getPreviousLocation(); Location ne... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... |
@Test public void whenInsertingActBetweenLastActAndEndAndRouteIsOpen_itCalculatesTpCostsFromPrevToNewAct() { TourActivity prevAct = mock(TourActivity.class); when(prevAct.getLocation()).thenReturn(loc("i")); when(prevAct.getIndex()).thenReturn(1); End nextAct = End.newInstance("j", 0.0, 0.0); TourActivity newAct = mock... | @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutStaticLocation) ((ActWithoutStaticLocation) prevAct).getPreviousLocation(); Location ne... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... | LocalActivityInsertionCostsCalculator implements ActivityInsertionCostsCalculator { @Override public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) { Location prevLocation = prevAct.getLocation(); if (prevAct instanceof ActWithoutSta... |
@Test public void whenRouteIsClosed_itCalculatesCostUpToEnd_v1() { TourActivity prevAct = mock(TourActivity.class); when(prevAct.getLocation()).thenReturn(loc("i")); TourActivity nextAct = mock(TourActivity.class); when(nextAct.getLocation()).thenReturn(loc("j")); TourActivity newAct = mock(TourActivity.class); when(ne... | public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; cost += startCost; double de... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... |
@Test public void whenRouteIsClosed_itCalculatesCostUpToEnd_v2() { TourActivity prevAct = mock(TourActivity.class); when(prevAct.getLocation()).thenReturn(loc("i")); End nextAct = new End("j", 0.0, 0.0); TourActivity newAct = mock(TourActivity.class); when(newAct.getLocation()).thenReturn(loc("k")); when(vehicle.isRetu... | public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; cost += startCost; double de... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... |
@Test public void whenRouteIsOpen_itCalculatesCostUpToEnd_v1() { TourActivity prevAct = mock(TourActivity.class); when(prevAct.getLocation()).thenReturn(loc("i")); TourActivity nextAct = mock(TourActivity.class); when(nextAct.getLocation()).thenReturn(loc("j")); TourActivity newAct = mock(TourActivity.class); when(newA... | public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; cost += startCost; double de... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... |
@Test public void whenRouteIsOpen_itCalculatesCostUpToEnd_v2() { TourActivity prevAct = mock(TourActivity.class); when(prevAct.getLocation()).thenReturn(loc("i")); End nextAct = End.newInstance("j", 0.0, 0.0); TourActivity newAct = mock(TourActivity.class); when(newAct.getLocation()).thenReturn(loc("k")); when(vehicle.... | public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; cost += startCost; double de... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... | AuxilliaryCostCalculator { public double costOfPath(final List<TourActivity> path, final double depTime, final Driver driver, final Vehicle vehicle) { if (path.isEmpty()) { return 0.0; } double cost = 0.0; Iterator<TourActivity> actIter = path.iterator(); TourActivity prevAct = actIter.next(); double startCost = 0.0; c... |
@Test public void itShouldRemoveCorrectNumber() { Service s1 = Service.Builder.newInstance("s1") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newInstance(1, 1)).build()).build(); Service s2 = Service.Builder.newInstance("s2") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.n... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJobs; } | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... |
@Test public void itShouldRemoveWorst() { Service s1 = Service.Builder.newInstance("s1") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newInstance(1, 1)).build()).build(); Service s2 = Service.Builder.newInstance("s2") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newInstan... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJobs; } | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... |
@Test public void itShouldRemoveWorstTwo() { Service s1 = Service.Builder.newInstance("s1") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newInstance(1, 1)).build()).build(); Service s2 = Service.Builder.newInstance("s2") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newIns... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJobs; } | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... |
@Test public void sixamWithWhiteSpace_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6 am"); assertEquals(6. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void itShouldRemoveShipment() { Service s1 = Service.Builder.newInstance("s1") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newInstance(1, 1)).build()).build(); Service s2 = Service.Builder.newInstance("s2") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newIns... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJobs; } | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... |
@Test public void itShouldRemoveShipmentFromSecondRoute() { Service s1 = Service.Builder.newInstance("s1") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newInstance(1, 1)).build()).build(); Service s2 = Service.Builder.newInstance("s2") .setLocation(Location.Builder.newInstance().setCoordinate(Co... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJobs; } | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... |
@Test public void itShouldRemoveServiceAndShipmentFromSecondRoute() { Service s1 = Service.Builder.newInstance("s1") .setLocation(Location.Builder.newInstance().setCoordinate(Coordinate.newInstance(1, 1)).build()).build(); Service s2 = Service.Builder.newInstance("s2") .setLocation(Location.Builder.newInstance().setCoo... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJobs; } | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... | RuinWorst extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJ... |
@Test public void test() { int stringLength = 4; int seedIndex = 4; int noActivities = 10; List<Integer> bounds = StringUtil.getLowerBoundsOfAllStrings(stringLength, seedIndex, noActivities); Assert.assertEquals(4, bounds.size()); Assert.assertEquals(1, (int) bounds.get(0)); Assert.assertEquals(2, (int) bounds.get(1));... | static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lower); } } ret... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... |
@Test public void test2() { int stringLength = 4; int seedIndex = 2; int noActivities = 10; List<Integer> bounds = StringUtil.getLowerBoundsOfAllStrings(stringLength, seedIndex, noActivities); Assert.assertEquals(3, bounds.size()); Assert.assertEquals(0, (int) bounds.get(0)); Assert.assertEquals(1, (int) bounds.get(1))... | static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lower); } } ret... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... |
@Test public void test3() { int stringLength = 4; int seedIndex = 0; int noActivities = 10; List<Integer> bounds = StringUtil.getLowerBoundsOfAllStrings(stringLength, seedIndex, noActivities); Assert.assertEquals(1, bounds.size()); Assert.assertEquals(0, (int) bounds.get(0)); } | static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lower); } } ret... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... |
@Test public void test4() { int stringLength = 4; int seedIndex = 9; int noActivities = 10; List<Integer> bounds = StringUtil.getLowerBoundsOfAllStrings(stringLength, seedIndex, noActivities); Assert.assertEquals(1, bounds.size()); Assert.assertEquals(6, (int) bounds.get(0)); } | static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lower); } } ret... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... |
@Test public void test5() { int stringLength = 4; int seedIndex = 8; int noActivities = 10; List<Integer> bounds = StringUtil.getLowerBoundsOfAllStrings(stringLength, seedIndex, noActivities); Assert.assertEquals(2, bounds.size()); Assert.assertEquals(5, (int) bounds.get(0)); Assert.assertEquals(6, (int) bounds.get(1))... | static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lower); } } ret... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... | StringUtil { static List<Integer> getLowerBoundsOfAllStrings(int length, int seedIndex, int routeLength) { List<Integer> lowerBounds = new ArrayList<>(); for (int i = 1; i <= length; i++) { int lower = seedIndex - (length - i); int upper = seedIndex + (i - 1); if (lower >= 0 && upper < routeLength) { lowerBounds.add(lo... |
@Test public void itShouldRuinTwoObviousClusters() { Service s0 = Service.Builder.newInstance("s0").setLocation(Location.newInstance(9, 0)).build(); Service s1 = Service.Builder.newInstance("s1").setLocation(Location.newInstance(9, 1)).build(); Service s2 = Service.Builder.newInstance("s2").setLocation(Location.newInst... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemoved, unassignedJobs); return unassignedJobs; } | RuinClusters extends AbstractRuinStrategy implements IterationStartsListener { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemove... | RuinClusters extends AbstractRuinStrategy implements IterationStartsListener { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemove... | RuinClusters extends AbstractRuinStrategy implements IterationStartsListener { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemove... | RuinClusters extends AbstractRuinStrategy implements IterationStartsListener { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { List<Job> unassignedJobs = new ArrayList<>(); int nOfJobs2BeRemoved = getRuinShareFactory().createNumberToBeRemoved(); ruin(vehicleRoutes, nOfJobs2BeRemove... |
@Test public void whenNoJobHasLocation_itShouldStillWork() { Service s1 = Service.Builder.newInstance("s1").build(); Service s2 = Service.Builder.newInstance("s2").build(); Service s3 = Service.Builder.newInstance("s3").build(); VehicleImpl v = VehicleImpl.Builder.newInstance("v") .setStartLocation(Location.Builder.new... | @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { if (vehicleRoutes.isEmpty()) { return Collections.emptyList(); } int nOfJobs2BeRemoved = Math.min(ruinShareFactory.createNumberToBeRemoved(), noJobsToMemorize); Collection<Job> jobs = vrp.getJobsWithLocation(); if (nOfJobs2BeRemoved =... | RuinRadial extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { if (vehicleRoutes.isEmpty()) { return Collections.emptyList(); } int nOfJobs2BeRemoved = Math.min(ruinShareFactory.createNumberToBeRemoved(), noJobsToMemorize); Collection<Job> jobs = vrp.getJ... | RuinRadial extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { if (vehicleRoutes.isEmpty()) { return Collections.emptyList(); } int nOfJobs2BeRemoved = Math.min(ruinShareFactory.createNumberToBeRemoved(), noJobsToMemorize); Collection<Job> jobs = vrp.getJ... | RuinRadial extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { if (vehicleRoutes.isEmpty()) { return Collections.emptyList(); } int nOfJobs2BeRemoved = Math.min(ruinShareFactory.createNumberToBeRemoved(), noJobsToMemorize); Collection<Job> jobs = vrp.getJ... | RuinRadial extends AbstractRuinStrategy { @Override public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes) { if (vehicleRoutes.isEmpty()) { return Collections.emptyList(); } int nOfJobs2BeRemoved = Math.min(ruinShareFactory.createNumberToBeRemoved(), noJobsToMemorize); Collection<Job> jobs = vrp.getJ... |
@Test public void sixAmWithWhiteSpace_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6 Am"); assertEquals(6. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void whenRunningJspritWithSingleCustomer_itShouldWork() { Service s = Service.Builder.newInstance("s1").setLocation(Location.newInstance(1, 1)).build(); VehicleImpl v = VehicleImpl.Builder.newInstance("v").setStartLocation(Location.newInstance(0, 0)).build(); VehicleRoutingProblem vrp = VehicleRoutingProbl... | public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } |
@Test public void whenActivatingStrat_itShouldBeReflectedV2() { Service s = Service.Builder.newInstance("s1").setLocation(Location.newInstance(1, 1)).build(); Service s2 = Service.Builder.newInstance("s2").setLocation(Location.newInstance(1, 2)).build(); Service s3 = Service.Builder.newInstance("s3").setLocation(Locati... | public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } |
@Test public void test_v4() { Service s = Service.Builder.newInstance("s1").setLocation(Location.newInstance(1, 1)).build(); Service s2 = Service.Builder.newInstance("s2").setLocation(Location.newInstance(1, 2)).build(); Service s3 = Service.Builder.newInstance("s3").setLocation(Location.newInstance(1, 2)).build(); Ser... | public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } |
@Test public void strategyDrawShouldBeReproducible() { Service s = Service.Builder.newInstance("s1").setLocation(Location.newInstance(1, 1)).build(); Service s2 = Service.Builder.newInstance("s2").setLocation(Location.newInstance(1, 2)).build(); Service s3 = Service.Builder.newInstance("s3").setLocation(Location.newIns... | public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } |
@Test public void ruinedJobsShouldBeReproducibleV2() { Service s = Service.Builder.newInstance("s1").setLocation(Location.newInstance(1, 1)).build(); Service s2 = Service.Builder.newInstance("s2").setLocation(Location.newInstance(1, 2)).build(); Service s3 = Service.Builder.newInstance("s3").setLocation(Location.newIns... | public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } |
@Test public void insertionShouldBeReproducible() { Service s = Service.Builder.newInstance("s1").setLocation(Location.newInstance(1, 1)).build(); Service s2 = Service.Builder.newInstance("s2").setLocation(Location.newInstance(1, 2)).build(); Service s3 = Service.Builder.newInstance("s3").setLocation(Location.newInstan... | public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } | Jsprit { public static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem) { return Jsprit.Builder.newInstance(vehicleRoutingProblem).buildAlgorithm(); } private Jsprit(Builder builder); static VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vehicleRoutingProblem); } |
@Test public void initialNumOfUnassignedShouldWorkCorrectly() { InsertionStrategy insertionStrategy = mock(InsertionStrategy.class); RuinStrategy ruinStrategy = mock(RuinStrategy.class); RuinAndRecreateModule module = new RuinAndRecreateModule("name", insertionStrategy, ruinStrategy); Collection<VehicleRoute> routes = ... | @Override public VehicleRoutingProblemSolution runAndGetSolution(VehicleRoutingProblemSolution previousVrpSolution) { Collection<Job> ruinedJobs = ruin.ruin(previousVrpSolution.getRoutes()); Set<Job> ruinedJobSet = new HashSet<>(ruinedJobs); List<Job> stillUnassignedInThisIteration = new ArrayList<>(); if (previousVrpS... | RuinAndRecreateModule implements SearchStrategyModule { @Override public VehicleRoutingProblemSolution runAndGetSolution(VehicleRoutingProblemSolution previousVrpSolution) { Collection<Job> ruinedJobs = ruin.ruin(previousVrpSolution.getRoutes()); Set<Job> ruinedJobSet = new HashSet<>(ruinedJobs); List<Job> stillUnassig... | RuinAndRecreateModule implements SearchStrategyModule { @Override public VehicleRoutingProblemSolution runAndGetSolution(VehicleRoutingProblemSolution previousVrpSolution) { Collection<Job> ruinedJobs = ruin.ruin(previousVrpSolution.getRoutes()); Set<Job> ruinedJobSet = new HashSet<>(ruinedJobs); List<Job> stillUnassig... | RuinAndRecreateModule implements SearchStrategyModule { @Override public VehicleRoutingProblemSolution runAndGetSolution(VehicleRoutingProblemSolution previousVrpSolution) { Collection<Job> ruinedJobs = ruin.ruin(previousVrpSolution.getRoutes()); Set<Job> ruinedJobSet = new HashSet<>(ruinedJobs); List<Job> stillUnassig... | RuinAndRecreateModule implements SearchStrategyModule { @Override public VehicleRoutingProblemSolution runAndGetSolution(VehicleRoutingProblemSolution previousVrpSolution) { Collection<Job> ruinedJobs = ruin.ruin(previousVrpSolution.getRoutes()); Set<Job> ruinedJobSet = new HashSet<>(ruinedJobs); List<Job> stillUnassig... |
@Test public void StrategyManagerInAction_addingStrategy_IsSuccessful() { SearchStrategyManager manager = new SearchStrategyManager(); SearchStrategy strat1 = mock(SearchStrategy.class); SearchStrategy strat2 = mock(SearchStrategy.class); when(strat1.getId()).thenReturn("strat1"); when(strat2.getId()).thenReturn("strat... | public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId() + " already in use. re... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... |
@Test(expected = IllegalStateException.class) public void StrategyManagerInAction_strategyIsNull_throwsException() { SearchStrategyManager manager = new SearchStrategyManager(); manager.addStrategy(null, 1.0); assertTrue(false); } | public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId() + " already in use. re... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... |
@Test(expected = IllegalStateException.class) public void StrategyManagerInAction_probabilityIsLowerThanZero_throwsException() { SearchStrategyManager manager = new SearchStrategyManager(); SearchStrategy strat = mock(SearchStrategy.class); when(strat.getId()).thenReturn("strat1"); manager.addStrategy(strat, -1.0); ass... | public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId() + " already in use. re... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... | SearchStrategyManager { public void addStrategy(SearchStrategy strategy, double weight) { if (strategy == null) { throw new IllegalStateException("strategy is null. make sure adding a valid strategy."); } if (id2index.keySet().contains(strategy.getId())) { throw new IllegalStateException("strategyId " + strategy.getId(... |
@Test public void sixPM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6PM"); assertEquals(6. * 3600. + 12. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void shouldReadNameOfService() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s = (Service) vrp.getJobs().get("1"); assertTrue(s.getName().equals("cleaning")); } | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void shouldReadNameOfShipment() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertTrue(s.getName().equals("deliver-smth"... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingVrp_problemTypeIsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); assertEquals(FleetSize.FINITE, vrp.getFleetSize()); } | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingVrp_vehiclesAreReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); assertEquals(5, vrp.getVehicles().size()); assertTrue(idsInCollection(Arrays.... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingVrp_vehicleTypesAreReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); assertEquals(3, vrp.getTypes().size()); } | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingVrpWithInfiniteSize_itReadsCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); assertEquals(FleetSize.FINITE, vrp.getFleetSize()); } | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_nuOfJobsIsReadThemCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); assertEquals(4, vrp.getJobs().size()); } | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingServices_itReadsThemCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); int servCounter = 0; for (Job j : vrp.getJobs().values()) { if (j instanceof... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingService1_skill1ShouldBeAssigned() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s = (Service) vrp.getJobs().get("1"); assertTrue(s.getRequiredSkil... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingService1_skill2ShouldBeAssigned() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s = (Service) vrp.getJobs().get("1"); assertTrue(s.getRequiredSkil... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void sixPMWithWhiteSpace_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6 PM"); assertEquals(6. * 3600. + 12. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void whenReadingService1_nuSkillsShouldBeCorrect() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s = (Service) vrp.getJobs().get("1"); assertEquals(2, s.getRequir... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingService2_nuSkillsOfV2ShouldBeCorrect() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s = (Service) vrp.getJobs().get("2"); assertEquals(0, s.getRe... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingShipments_itReadsThemCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); int shipCounter = 0; for (Job j : vrp.getJobs().values()) { if (j instanceo... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingShipment3_skill1ShouldBeAssigned() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertTrue(s.getRequiredS... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingShipment3_skill2ShouldBeAssigned() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertTrue(s.getRequiredS... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingShipment3_nuSkillsShouldBeCorrect() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEquals(2, s.getReq... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingShipment4_nuSkillsOfV2ShouldBeCorrect() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("4"); assertEquals(0, s.ge... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingServices_capOfService1IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s1 = (Service) vrp.getJobs().get("1"); assertEquals(1, s1.ge... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingServices_durationOfService1IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s1 = (Service) vrp.getJobs().get("1"); assertEquals(10.... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingServices_twOfService1IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s1 = (Service) vrp.getJobs().get("1"); assertEquals(0.0, s1.g... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void sixpMWithWhiteSpace_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6 pM"); assertEquals(6. * 3600. + 12. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void whenReadingServices_typeOfService1IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Service s1 = (Service) vrp.getJobs().get("1"); assertEquals("servic... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_capOfShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEquals(10, s.getS... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_pickupServiceTimeOfShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEqu... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_pickupTimeWindowOfShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEqua... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_deliveryTimeWindowOfShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEq... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_deliveryServiceTimeOfShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertE... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_deliveryCoordShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEquals(10... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_pickupCoordShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEquals(10.0... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_deliveryIdShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEquals("i(9,... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_pickupIdShipment3IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("3"); assertEquals("i(3,9)... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void sixpmWithWhiteSpace_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6 pm"); assertEquals(6. * 3600. + 12. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void whenReadingJobs_pickupLocationIdShipment4IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("4"); assertEquals... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_deliveryLocationIdShipment4IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("4"); assertEqua... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_pickupServiceTimeOfShipment4IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("4"); assertEqu... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingJobs_deliveryServiceTimeOfShipment4IsReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(inputStream); VehicleRoutingProblem vrp = builder.build(); Shipment s = (Shipment) vrp.getJobs().get("4"); assertE... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingInitialRouteWithShipment4_thisShipmentShouldNotAppearInJobMap() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder).read(getClass().getResourceAsStream("finiteVrpWithInitialSolutionForReaderTest.xml")); VehicleRoutingProblem vrp =... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingInitialRouteWithDepTime10_departureTimeOfRouteShouldBeReadCorrectly() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder).read(getClass().getResourceAsStream("finiteVrpWithInitialSolutionForReaderTest.xml")); VehicleRoutingProblem... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingInitialRoute_nuInitialRoutesShouldBeCorrect() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(getClass().getResourceAsStream("finiteVrpWithInitialSolutionForReaderTest.xml")); VehicleRoutingProblem vrp = builder.bui... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void whenReadingInitialRoute_nuActivitiesShouldBeCorrect() { VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance(); new VrpXMLReader(builder, null).read(getClass().getResourceAsStream("finiteVrpWithInitialSolutionForReaderTest.xml")); VehicleRoutingProblem vrp = builder.build(... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void testRead_ifReaderIsCalled_itReadsSuccessfullyV2() { VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance(); ArrayList<VehicleRoutingProblemSolution> solutions = new ArrayList<VehicleRoutingProblemSolution>(); new VrpXMLReader(vrpBuilder, solutions).read(getClass().getRe... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void testRead_ifReaderIsCalled_itReadsSuccessfully() { new VrpXMLReader(VehicleRoutingProblem.Builder.newInstance(), new ArrayList<VehicleRoutingProblemSolution>()).read(getClass().getResourceAsStream("lui-shen-solution.xml")); assertTrue(true); } | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void sixPmWithWhiteSpace_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6 Pm"); assertEquals(6. * 3600. + 12. * 3600, sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void unassignedJobShouldBeRead() { VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance(); ArrayList<VehicleRoutingProblemSolution> solutions = new ArrayList<VehicleRoutingProblemSolution>(); new VrpXMLReader(vrpBuilder, solutions).read(getClass().getResourceAsStream("finite... | public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } } | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... | VrpXMLReader { public void read(String filename) { logger.debug("read vrp: {}", filename); XMLConfiguration xmlConfig = createXMLConfiguration(); try { xmlConfig.load(filename); } catch (ConfigurationException e) { throw new RuntimeException(e); } read(xmlConfig); } VrpXMLReader(VehicleRoutingProblem.Builder vrpBuilder... |
@Test public void outputStreamAndFileContentsAreEqual() throws IOException { VehicleRoutingProblem.Builder builder = twoVehicleTypesAndImpls(); VehicleRoutingProblem vrp = builder.build(); VrpXMLWriter vrpXMLWriter = new VrpXMLWriter(vrp, null); ByteArrayOutputStream os = (ByteArrayOutputStream) vrpXMLWriter.write(); S... | public void write(String filename) { if (!filename.endsWith(".xml")) filename += ".xml"; log.info("write vrp: " + filename); XMLConf xmlConfig = createXMLConfiguration(); try { xmlConfig.setFileName(filename); Writer out = new FileWriter(filename); XMLSerializer serializer = new XMLSerializer(out, createOutputFormat())... | VrpXMLWriter { public void write(String filename) { if (!filename.endsWith(".xml")) filename += ".xml"; log.info("write vrp: " + filename); XMLConf xmlConfig = createXMLConfiguration(); try { xmlConfig.setFileName(filename); Writer out = new FileWriter(filename); XMLSerializer serializer = new XMLSerializer(out, create... | VrpXMLWriter { public void write(String filename) { if (!filename.endsWith(".xml")) filename += ".xml"; log.info("write vrp: " + filename); XMLConf xmlConfig = createXMLConfiguration(); try { xmlConfig.setFileName(filename); Writer out = new FileWriter(filename); XMLSerializer serializer = new XMLSerializer(out, create... | VrpXMLWriter { public void write(String filename) { if (!filename.endsWith(".xml")) filename += ".xml"; log.info("write vrp: " + filename); XMLConf xmlConfig = createXMLConfiguration(); try { xmlConfig.setFileName(filename); Writer out = new FileWriter(filename); XMLSerializer serializer = new XMLSerializer(out, create... | VrpXMLWriter { public void write(String filename) { if (!filename.endsWith(".xml")) filename += ".xml"; log.info("write vrp: " + filename); XMLConf xmlConfig = createXMLConfiguration(); try { xmlConfig.setFileName(filename); Writer out = new FileWriter(filename); XMLSerializer serializer = new XMLSerializer(out, create... |
@Test public void sixAMWithLeadingZero_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("06AM"); assertEquals(6. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_twelveMin_AM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:12AM"); assertEquals(6. * 3600. + 12. * 60., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_sixMin_AM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:6AM"); assertEquals(6. * 3600. + 6. * 60., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void whenReadingCustomersCordeauInstance_customerOneShouldHaveCorrectCoordinates() { VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance(); new CordeauReader(vrpBuilder).read(getPath("p01")); VehicleRoutingProblem vrp = vrpBuilder.build(); Service service = (Service) vrp.ge... | public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder>>(); int depotC... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... |
@Test public void sixHour_sixMinWithLeadingZero_AM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:06AM"); assertEquals(6. * 3600. + 6. * 60., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_twelveMin_PM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:12PM"); assertEquals(6. * 3600. + 12. * 60. + 12. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_sixMin_PM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:6PM"); assertEquals(6. * 3600. + 6. * 60. + 12. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_sixMinWithLeadingZero_PM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:06PM"); assertEquals(6. * 3600. + 6. * 60. + 12. * 3600., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_sixMinWithLeadingZero_twelveSec_PM_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:06:12PM"); assertEquals(6. * 3600. + 6. * 60. + 12. * 3600. + 12., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_sixMinWithLeadingZero_twelveSec_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:06:12"); assertEquals(6. * 3600. + 6. * 60. + 12., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void sixHour_sixMinWithLeadingZero_sixSecWithLeadingZero_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("6:06:06"); assertEquals(6. * 3600. + 6. * 60. + 6., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test(expected = IllegalArgumentException.class) public void whenTimeStringHasNoDigit_itThrowsException() { Time.parseTimeToSeconds("PM"); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test(expected = IllegalArgumentException.class) public void whenTimeStringHasMilliSeconds_itThrowsException() { Time.parseTimeToSeconds("01:00:12:01PM"); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void zeroHour_zeroMinWithLeadingZero_oneSecWithLeadingZero_shouldBeParsedCorrectly() { double sec = Time.parseTimeToSeconds("0:00:01"); assertEquals(1., sec, 0.01); } | public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split(":"); ... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... | Time { public static double parseTimeToSeconds(String timeString) { if (timeString.substring(0, 1).matches("\\D")) throw new IllegalArgumentException("timeString must start with digit [0-9]"); double dayTime = 0.; if (timeString.toLowerCase().contains("pm")) { dayTime = 12. * 3600.; } String[] tokens = timeString.split... |
@Test public void whenReadingCustomersCordeauInstance_customerTwoShouldHaveCorrectServiceDuration() { VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance(); new CordeauReader(vrpBuilder).read(getPath("p01")); VehicleRoutingProblem vrp = vrpBuilder.build(); Service service = (Service) vr... | public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder>>(); int depotC... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... | CordeauReader { public void read(String fileName) { vrpBuilder.setFleetSize(FleetSize.FINITE); BufferedReader reader = getReader(fileName); int vrpType; int nOfDepots = 0; int nOfCustomers = 0; int nOfVehiclesAtEachDepot = 0; int counter = 0; String line; List<List<Builder>> vehiclesAtDepot = new ArrayList<List<Builder... |
@Test public void shouldReturnCorrectCapacityReasonCode() { Service service = Service.Builder.newInstance("1").addSizeDimension(0, 5).setLocation(Location.newInstance(5, 7)).build(); VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().setFleetSize(VehicleRoutingProblem.FleetSize.FINITE).addVehicle(v... | public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstraintName(reasons); return toCode(mostLikelyReason); } | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... |
@Test public void shouldReturnCorrectSkillReasonCode() { Service service = Service.Builder.newInstance("1").addSizeDimension(0, 1).addRequiredSkill("ice").setLocation(Location.newInstance(5, 7)).build(); VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().setFleetSize(VehicleRoutingProblem.FleetSize... | public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstraintName(reasons); return toCode(mostLikelyReason); } | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... |
@Test public void shouldReturnCorrectTWReasonCode() { Service service = Service.Builder.newInstance("1").addSizeDimension(0, 1).setTimeWindow(TimeWindow.newInstance(110, 200)).setLocation(Location.newInstance(5, 7)).build(); VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().setFleetSize(VehicleRou... | public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstraintName(reasons); return toCode(mostLikelyReason); } | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... | UnassignedJobReasonTracker implements JobUnassignedListener { public int getMostLikelyReasonCode(String jobId) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(jobId)) return -1; Frequency reasons = this.failedConstraintNamesFrequencyMapping.get(jobId); String mostLikelyReason = getMostLikelyFailedConstrai... |
@Test public void getMostLikelyTest() { Frequency frequency = new Frequency(); frequency.addValue("a"); frequency.addValue("b"); frequency.addValue("a"); frequency.addValue("a"); frequency.addValue("a"); frequency.addValue("a"); frequency.addValue("a"); Assert.assertEquals("a", UnassignedJobReasonTracker.getMostLikelyF... | public static String getMostLikelyFailedConstraintName(Frequency failedConstraintNamesFrequency) { if (failedConstraintNamesFrequency == null || failedConstraintNamesFrequency.getUniqueCount() == 0) return NO_REASON; Iterator<Map.Entry<Comparable<?>, Long>> entryIterator = failedConstraintNamesFrequency.entrySetIterato... | UnassignedJobReasonTracker implements JobUnassignedListener { public static String getMostLikelyFailedConstraintName(Frequency failedConstraintNamesFrequency) { if (failedConstraintNamesFrequency == null || failedConstraintNamesFrequency.getUniqueCount() == 0) return NO_REASON; Iterator<Map.Entry<Comparable<?>, Long>> ... | UnassignedJobReasonTracker implements JobUnassignedListener { public static String getMostLikelyFailedConstraintName(Frequency failedConstraintNamesFrequency) { if (failedConstraintNamesFrequency == null || failedConstraintNamesFrequency.getUniqueCount() == 0) return NO_REASON; Iterator<Map.Entry<Comparable<?>, Long>> ... | UnassignedJobReasonTracker implements JobUnassignedListener { public static String getMostLikelyFailedConstraintName(Frequency failedConstraintNamesFrequency) { if (failedConstraintNamesFrequency == null || failedConstraintNamesFrequency.getUniqueCount() == 0) return NO_REASON; Iterator<Map.Entry<Comparable<?>, Long>> ... | UnassignedJobReasonTracker implements JobUnassignedListener { public static String getMostLikelyFailedConstraintName(Frequency failedConstraintNamesFrequency) { if (failedConstraintNamesFrequency == null || failedConstraintNamesFrequency.getUniqueCount() == 0) return NO_REASON; Iterator<Map.Entry<Comparable<?>, Long>> ... |
@Test public void whenAddingDistanceToAsymmetricMatrix_itShouldReturnCorrectValues() { FastVehicleRoutingTransportCostsMatrix.Builder matrixBuilder = FastVehicleRoutingTransportCostsMatrix.Builder.newInstance(3, false); matrixBuilder.addTransportDistance(1, 2, 2.); FastVehicleRoutingTransportCostsMatrix matrix = matrix... | @Override public double getTransportCost(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + from + " to " + to + " < 0 "); if (vehicle == null) return getDistance(from.getIndex(), to.getI... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportCost(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportCost(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportCost(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportCost(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... |
@Test public void whenAddingTimeToSymmetricMatrix_itShouldReturnCorrectValues() { FastVehicleRoutingTransportCostsMatrix.Builder matrixBuilder = FastVehicleRoutingTransportCostsMatrix.Builder.newInstance(3, true); matrixBuilder.addTransportTime(1, 2, 2.); FastVehicleRoutingTransportCostsMatrix matrix = matrixBuilder.bu... | @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + from + " to " + to + " < 0 "); int timeIndex = 1; return get(from.getIndex(), to.getIndex(), ti... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... |
@Test public void whenAddingTimeToAsymmetricMatrix_itShouldReturnCorrectValues() { FastVehicleRoutingTransportCostsMatrix.Builder matrixBuilder = FastVehicleRoutingTransportCostsMatrix.Builder.newInstance(3, false); matrixBuilder.addTransportTime(1, 2, 2.); FastVehicleRoutingTransportCostsMatrix matrix = matrixBuilder.... | @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + from + " to " + to + " < 0 "); int timeIndex = 1; return get(from.getIndex(), to.getIndex(), ti... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... | FastVehicleRoutingTransportCostsMatrix extends AbstractForwardVehicleRoutingTransportCosts { @Override public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) { if (from.getIndex() < 0 || to.getIndex() < 0) throw new IllegalArgumentException("index of from " + fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.