@@ -0,0 +1,3072 @@
+package jsprit.core.algorithm.state;%0A%0Aimport jsprit.core.algorithm.VehicleRoutingAlgorithm;%0Aimport jsprit.core.algorithm.box.GreedySchrimpfFactory;%0Aimport jsprit.core.problem.VehicleRoutingProblem;%0Aimport jsprit.core.problem.job.Service;%0Aimport jsprit.core.problem.solution.VehicleRoutingProblemSolution;%0Aimport jsprit.core.problem.solution.route.activity.TimeWindow;%0Aimport jsprit.core.problem.vehicle.VehicleImpl;%0Aimport jsprit.core.util.Coordinate;%0Aimport jsprit.core.util.Solutions;%0Aimport org.junit.Test;%0A%0Aimport java.util.Collection;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Apublic class BadJobListTest %7B%0A%0A    @Test%0A    public void job2ShouldBeInBadJobList_dueToTimeWindow()%7B%0A        VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();%0A        builder.addVehicle(VehicleImpl.Builder.newInstance(%22v1%22).setEarliestStart(0).setLatestArrival(12).setStartLocationCoordinate(Coordinate.newInstance(1, 1)).build());%0A        Service job1 = Service.Builder.newInstance(%22job1%22).setCoord(Coordinate.newInstance(0, 0)).setTimeWindow(TimeWindow.newInstance(0, 12)).setServiceTime(1).build();%0A        builder.addJob(job1);%0A        Service job2 = Service.Builder.newInstance(%22job2%22).setCoord(Coordinate.newInstance(2, 2)).setTimeWindow(TimeWindow.newInstance(12, 24)).setServiceTime(1).build();%0A        builder.addJob(job2);%0A%0A        VehicleRoutingProblem vrp = builder.build();%0A        VehicleRoutingAlgorithm algorithm = new GreedySchrimpfFactory().createAlgorithm(vrp);%0A        algorithm.setMaxIterations(10);%0A        Collection%3CVehicleRoutingProblemSolution%3E solutions = algorithm.searchSolutions();%0A%0A        VehicleRoutingProblemSolution solution = Solutions.bestOf(solutions);%0A        assertTrue(!solution.getBadJobs().contains(job1));%0A        assertTrue(solution.getBadJobs().contains(job2));%0A    %7D%0A%0A    @Test%0A    public void job2ShouldBeInBadJobList_dueToSize()%7B%0A        VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();%0A        builder.addVehicle(VehicleImpl.Builder.newInstance(%22v1%22).setEarliestStart(0).setLatestArrival(12).setStartLocationCoordinate(Coordinate.newInstance(1, 1)).build());%0A        Service job1 = Service.Builder.newInstance(%22job1%22).setCoord(Coordinate.newInstance(0, 0)).setTimeWindow(TimeWindow.newInstance(0, 12)).setServiceTime(1).build();%0A        builder.addJob(job1);%0A        Service job2 = Service.Builder.newInstance(%22job2%22).setCoord(Coordinate.newInstance(2, 2)).addSizeDimension(0,10).setTimeWindow(TimeWindow.newInstance(0, 12)).setServiceTime(1).build();%0A        builder.addJob(job2);%0A%0A        VehicleRoutingProblem vrp = builder.build();%0A        VehicleRoutingAlgorithm algorithm = new GreedySchrimpfFactory().createAlgorithm(vrp);%0A        algorithm.setMaxIterations(10);%0A        Collection%3CVehicleRoutingProblemSolution%3E solutions = algorithm.searchSolutions();%0A%0A        VehicleRoutingProblemSolution solution = Solutions.bestOf(solutions);%0A        assertTrue(!solution.getBadJobs().contains(job1));%0A        assertTrue(solution.getBadJobs().contains(job2));%0A    %7D%0A%0A%7D%0A

add bad job list