Package jsprit.core.problem.solution.route.activity

Examples of jsprit.core.problem.solution.route.activity.TourActivity


            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        TourActivity act = route.getActivities().get(0);
        Capacity cap = analyser.getCapacityViolationAfterActivity(act,route);
        for(int i=0;i<cap.getNuOfDimensions();i++){
            assertTrue(cap.get(i) == 0);
        }
    }
View Full Code Here


            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        TourActivity act = route.getActivities().get(1);
        Capacity cap = analyser.getCapacityViolationAfterActivity(act,route);
        for(int i=0;i<cap.getNuOfDimensions();i++){
            assertTrue(cap.get(i) == 0);
        }
    }
View Full Code Here

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        TourActivity act = route.getActivities().get(2);
        Capacity cap = analyser.getCapacityViolationAfterActivity(act,route);
        for(int i=0;i<cap.getNuOfDimensions();i++){
            assertTrue(cap.get(i) == 0);
        }
    }
View Full Code Here

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        TourActivity act = route.getActivities().get(3);
        Capacity cap = analyser.getCapacityViolationAfterActivity(act,route);
        for(int i=0;i<cap.getNuOfDimensions();i++){
            assertTrue(cap.get(i) == 0);
        }
    }
View Full Code Here

            public double getDistance(String fromLocationId, String toLocationId) {
                return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
            }
        });
        VehicleRoute route = solution.getRoutes().iterator().next();
        TourActivity act = route.getEnd();
        Capacity cap = analyser.getCapacityViolationAfterActivity(act,route);
        for(int i=0;i<cap.getNuOfDimensions();i++){
            assertTrue(cap.get(i) == 0);
        }
    }
View Full Code Here

    @Test
    public void shipmentViolation_shouldWorkWhenViolated(){
        buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore();
        VehicleRoute route = solution.getRoutes().iterator().next();
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);
        TourActivity deliverShipment = route.getActivities().get(2);
        route.getTourActivities().removeActivity(deliverShipment);
//        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);

        SolutionAnalyser analyser = new SolutionAnalyser(vrp,solution, new SolutionAnalyser.DistanceCalculator() {
            @Override
View Full Code Here

    @Test
    public void shipmentViolationAtActivity_shouldWorkWhenRemovingDelivery(){
        buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore();
        VehicleRoute route = solution.getRoutes().iterator().next();
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);
        TourActivity deliverShipment = route.getActivities().get(2);
        route.getTourActivities().removeActivity(deliverShipment);
//        assertFalse(route.getTourActivities().hasActivity(pickupShipment));
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);

        SolutionAnalyser analyser = new SolutionAnalyser(vrp,solution, new SolutionAnalyser.DistanceCalculator() {
View Full Code Here

    @Test
    public void shipmentViolation_shouldWorkWhenRemovingDelivery(){
        buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore();
        VehicleRoute route = solution.getRoutes().iterator().next();
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);
        TourActivity deliverShipment = route.getActivities().get(2);
        route.getTourActivities().removeActivity(deliverShipment);
        assertFalse(route.getTourActivities().hasActivity(deliverShipment));
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);

        SolutionAnalyser analyser = new SolutionAnalyser(vrp,solution, new SolutionAnalyser.DistanceCalculator() {
View Full Code Here

    @Test
    public void shipmentViolationAtActivity_shouldWorkWhenRemovingPickup(){
        buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore();
        VehicleRoute route = solution.getRoutes().iterator().next();
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);
        TourActivity pickupShipment = route.getActivities().get(1);
        route.getTourActivities().removeActivity(pickupShipment);
        assertFalse(route.getTourActivities().hasActivity(pickupShipment));
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);

        SolutionAnalyser analyser = new SolutionAnalyser(vrp,solution, new SolutionAnalyser.DistanceCalculator() {
View Full Code Here

    @Test
    public void shipmentViolationOnRoute_shouldWorkWhenRemovingPickup(){
        buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore();
        VehicleRoute route = solution.getRoutes().iterator().next();
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);
        TourActivity pickupShipment = route.getActivities().get(1);
        route.getTourActivities().removeActivity(pickupShipment);
        assertFalse(route.getTourActivities().hasActivity(pickupShipment));
        SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);

        SolutionAnalyser analyser = new SolutionAnalyser(vrp,solution, new SolutionAnalyser.DistanceCalculator() {
View Full Code Here

TOP

Related Classes of jsprit.core.problem.solution.route.activity.TourActivity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.