Package jsprit.core.problem.vehicle

Examples of jsprit.core.problem.vehicle.VehicleImpl$NoVehicle


    @Test
    public void whenAddingPickup_itShouldBeTreatedAsPickup(){

        Pickup pickup = (Pickup) Pickup.Builder.newInstance("pick").setLocationId("pickLoc").build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId("startLoc").build();
        VehicleRoute route = VehicleRoute.Builder.newInstance(vehicle).addService(pickup).build();

        TourActivity act = route.getActivities().get(0);
        assertTrue(act.getName().equals("pickup"));
        assertTrue(act instanceof PickupService);
View Full Code Here


    @Test
    public void whenAddingPickup_itShouldBeAdded(){

        Pickup pickup = (Pickup) Pickup.Builder.newInstance("pick").setLocationId("pickLoc").build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId("startLoc").build();
        VehicleRoute route = VehicleRoute.Builder.newInstance(vehicle).addPickup(pickup).build();

        TourActivity act = route.getActivities().get(0);
        assertTrue(act.getName().equals("pickup"));
        assertTrue(act instanceof PickupService);
View Full Code Here

    @Test
    public void whenAddingDelivery_itShouldBeTreatedAsDelivery(){

        Delivery delivery = (Delivery) Delivery.Builder.newInstance("delivery").setLocationId("deliveryLoc").build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId("startLoc").build();
        VehicleRoute route = VehicleRoute.Builder.newInstance(vehicle).addService(delivery).build();

        TourActivity act = route.getActivities().get(0);
        assertTrue(act.getName().equals("delivery"));
        assertTrue(act instanceof DeliverService);
View Full Code Here

    @Test
    public void whenAddingDelivery_itShouldBeAdded(){

        Delivery delivery = (Delivery) Delivery.Builder.newInstance("delivery").setLocationId("deliveryLoc").build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId("startLoc").build();
        VehicleRoute route = VehicleRoute.Builder.newInstance(vehicle).addDelivery(delivery).build();

        TourActivity act = route.getActivities().get(0);
        assertTrue(act.getName().equals("delivery"));
        assertTrue(act instanceof DeliverService);
View Full Code Here

    public static void main(String[] args) {


        VehicleType type = VehicleTypeImpl.Builder.newInstance("type").addCapacityDimension(BANANAS_DIMENSION_INDEX,10)
                .addCapacityDimension(APPLES_DIMENSION_INDEX, 20).build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
                .setType(type).build();

        Shipment bananas = Shipment.Builder.newInstance("bananas_1").addSizeDimension(BANANAS_DIMENSION_INDEX,1)
                .setPickupCoord(Coordinate.newInstance(1, 8)).setDeliveryCoord(Coordinate.newInstance(10, 8)).build();
View Full Code Here

     * play with these location to see which impact they have on customer-sequences.
     */
    Builder vehicleBuilder1 = VehicleImpl.Builder.newInstance("v1");
    vehicleBuilder1.setStartLocationCoordinate(Coordinate.newInstance(10, 10));
    vehicleBuilder1.setType(vehicleType);
    VehicleImpl vehicle1 = vehicleBuilder1.build();
   
    Builder vehicleBuilder2 = VehicleImpl.Builder.newInstance("v2");
    vehicleBuilder2.setStartLocationCoordinate(Coordinate.newInstance(30, 30)).setEndLocationCoordinate(Coordinate.newInstance(30, 19));
    vehicleBuilder2.setType(vehicleType);
    VehicleImpl vehicle2 = vehicleBuilder2.build();
 
   
    /*
     * build shipments at the required locations, each with a capacity-demand of 1.
     *
 
View Full Code Here

     * get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
     */
    Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
    vehicleBuilder.setStartLocationCoordinate(Coordinate.newInstance(10, 10));
    vehicleBuilder.setType(vehicleType);
    VehicleImpl vehicle = vehicleBuilder.build();
   
    /*
     * build services at the required locations, each with a capacity-demand of 1.
     */
    Service service1 = Service.Builder.newInstance("1").addSizeDimension(WEIGHT_INDEX, 1).setCoord(Coordinate.newInstance(5, 7)).build();
View Full Code Here

   
   
    //add vehicle - finite fleet
    //2xtype1
    VehicleType type1 = VehicleTypeImpl.Builder.newInstance("type_1").addCapacityDimension(0, 120).setCostPerDistance(1.0).build();
    VehicleImpl vehicle1_1 = VehicleImpl.Builder.newInstance("1_1").setStartLocationCoordinate(Coordinate.newInstance(40, 40)).setType(type1).build();
    vrpBuilder.addVehicle(vehicle1_1);
    VehicleImpl vehicle1_2 = VehicleImpl.Builder.newInstance("1_2").setStartLocationCoordinate(Coordinate.newInstance(40, 40)).setType(type1).build();
    vrpBuilder.addVehicle(vehicle1_2);
    //1xtype2
    VehicleType type2 = VehicleTypeImpl.Builder.newInstance("type_2").addCapacityDimension(0, 160).setCostPerDistance(1.1).build();
    VehicleImpl vehicle2_1 = VehicleImpl.Builder.newInstance("2_1").setStartLocationCoordinate(Coordinate.newInstance(40, 40)).setType(type2).build();
    vrpBuilder.addVehicle(vehicle2_1);
    //1xtype3
    VehicleType type3 = VehicleTypeImpl.Builder.newInstance("type_3").addCapacityDimension(0, 300).setCostPerDistance(1.3).build();
    VehicleImpl vehicle3_1 = VehicleImpl.Builder.newInstance("3_1").setStartLocationCoordinate(Coordinate.newInstance(40, 40)).setType(type3).build();
    vrpBuilder.addVehicle(vehicle3_1);
   
    //add penaltyVehicles to allow invalid solutions temporarily
//    vrpBuilder.addPenaltyVehicles(5, 1000);
   
View Full Code Here

     * play with these location to see which impact they have on customer-sequences.
     */
    Builder vehicleBuilder1 = VehicleImpl.Builder.newInstance("wheelchair_bus");
    vehicleBuilder1.setStartLocationCoordinate(Coordinate.newInstance(10, 10));
    vehicleBuilder1.setType(vehicleType_wheelchair);
    VehicleImpl vehicle1 = vehicleBuilder1.build();
   
    Builder vehicleBuilder1_2 = VehicleImpl.Builder.newInstance("wheelchair_bus_2");
    vehicleBuilder1_2.setStartLocationCoordinate(Coordinate.newInstance(10, 10));
    vehicleBuilder1_2.setType(vehicleType_wheelchair);
    VehicleImpl vehicle1_2 = vehicleBuilder1_2.build();
   
    Builder vehicleBuilder2 = VehicleImpl.Builder.newInstance("passenger_bus");
    vehicleBuilder2.setStartLocationCoordinate(Coordinate.newInstance(30, 30)).setEndLocationCoordinate(Coordinate.newInstance(30, 19));
    vehicleBuilder2.setType(vehicleType_solelypassenger);
    VehicleImpl vehicle2 = vehicleBuilder2.build();
   
    Builder vehicleBuilder2_2 = VehicleImpl.Builder.newInstance("passenger_bus_2");
    vehicleBuilder2_2.setStartLocationCoordinate(Coordinate.newInstance(30, 30)).setEndLocationCoordinate(Coordinate.newInstance(30, 19));
    vehicleBuilder2_2.setType(vehicleType_solelypassenger);
    VehicleImpl vehicle2_2 = vehicleBuilder2_2.build();
 
   
    /*
     * build shipments at the required locations, each with a capacity-demand of 1.
     *
 
View Full Code Here

    VehicleTypeImpl bigType = typeBuilder.build();
   
    VehicleImpl.Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
    vehicleBuilder.setStartLocationId("1");
    vehicleBuilder.setType(bigType);
    VehicleImpl bigVehicle = vehicleBuilder.build();
   
    /*
     * start building the problem
     */
    VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
View Full Code Here

TOP

Related Classes of jsprit.core.problem.vehicle.VehicleImpl$NoVehicle

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.