Package jsprit.core.problem.vehicle

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


        String vehicleId = depotCounter + "_" + (i+1) + "_vehicle";
        VehicleImpl.Builder vehicleBuilder = VehicleImpl.Builder.newInstance(vehicleId);
        vehicleBuilder.setStartLocationCoordinate(depotCoord);
        vehicleBuilder.setType(vehicleType);
        vehicleBuilder.setLatestArrival(maxDuration);
        VehicleImpl vehicle = vehicleBuilder.build();
        vrpBuilder.addVehicle(vehicle);
      }
      depotCounter++;
    }
   
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 shipments at the required locations, each with a capacity-demand of 1.
     * 4 shipments
     * 1: (5,7)->(6,9)
View Full Code Here

     * some preparation - create output folder
     */
    Examples.createOutputFolder();
   
    VehicleType type = VehicleTypeImpl.Builder.newInstance("type").addCapacityDimension(0, 2).setCostPerDistance(1).setCostPerTime(2).build();
    VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId("0").setType(type).build();
   
    Service s1 = Service.Builder.newInstance("1").addSizeDimension(0, 1).setLocationId("1").build();
    Service s2 = Service.Builder.newInstance("2").addSizeDimension(0, 1).setLocationId("2").build();
    Service s3 = Service.Builder.newInstance("3").addSizeDimension(0, 1).setLocationId("3").build();
   
View Full Code Here

     * get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
     */
    Builder vehicleBuilder = Builder.newInstance("vehicle");
    vehicleBuilder.setStartLocationCoordinate(Coordinate.newInstance(10, 10));
    vehicleBuilder.setType(vehicleType);
    VehicleImpl vehicle = vehicleBuilder.build();

        Builder vehicle2Builder = Builder.newInstance("vehicle2");
        vehicle2Builder.setStartLocationCoordinate(Coordinate.newInstance(1, 1));
        vehicle2Builder.setType(vehicleType);
        vehicle2Builder.addSkill("drill");
        VehicleImpl vehicle2 = vehicle2Builder.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

  public void whenInsertingServiceWhileNoCapIsAvailable_itMustReturnTheCorrectInsertionIndex(){
    Delivery delivery = (Delivery) Delivery.Builder.newInstance("del").addSizeDimension(0, 41).setLocationId("10,10").build();
    Pickup pickup = (Pickup) Pickup.Builder.newInstance("pick").addSizeDimension(0, 15).setLocationId("0,10").build();

    VehicleType type = VehicleTypeImpl.Builder.newInstance("t").addCapacityDimension(0, 50).setCostPerDistance(1).build();
    VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("0,0").setType(type).build();

        final VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addJob(delivery).addJob(pickup).addVehicle(vehicle).build();

        VehicleRoute route = VehicleRoute.emptyRoute();
    route.setVehicleAndDepartureTime(vehicle, 0.0);
View Full Code Here

                .setCostPerTime(20.).build();

        VehicleType type2 = VehicleTypeImpl.Builder.newInstance("medium").addCapacityDimension(0,1000).addCapacityDimension(1,4000)
                .setCostPerTime(200.).setFixedCost(1000.).build();

        VehicleImpl v1 = VehicleImpl.Builder.newInstance("v1").setStartLocationId("startLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
                .setEndLocationId("endLoc").setEndLocationCoordinate(Coordinate.newInstance(12, 12))
                .addSkill("screw-driver")
                .setType(type)
                .setLatestArrival(1000.)
                .build();

        VehicleImpl v2 = VehicleImpl.Builder.newInstance("v2").setStartLocationId("startLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
                .setType(type2)
                .setReturnToDepot(false)
                .addSkill("joo")
                .build();
View Full Code Here

        Service s2 = Service.Builder.newInstance("s2").setLocationId("20,0").setTimeWindow(TimeWindow.newInstance(20.,20.)).build();
        Service s3 = Service.Builder.newInstance("s3").setLocationId("30,0").setTimeWindow(TimeWindow.newInstance(30.,30.)).build();
        vrpBuilder.addJob(s1).addJob(s2).addJob(s3);

        VehicleType type = VehicleTypeImpl.Builder.newInstance("type").build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId("0,0").setType(type).build();
        vrpBuilder.addVehicle(vehicle);
        vrp = vrpBuilder.build();

        activityFactory = new JobActivityFactory() {
            @Override
View Full Code Here

  public void whenNewVehicleCapacityIsNotSufficiant1_returnFalse(){
    final Service pickup = createPickup("pick",2);
    final Service pickup2 = createPickup("pick2",3);

        VehicleType type = VehicleTypeImpl.Builder.newInstance("type").addCapacityDimension(0,3).build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v").setType(type).setStartLocationId("loc").build();

        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addVehicle(vehicle).addJob(pickup).addJob(pickup2).build();

    VehicleRoute route = VehicleRoute.Builder.newInstance(vehicle).setJobActivityFactory(vrp.getJobActivityFactory()).addService(pickup2).build();
View Full Code Here

  @Test
  public void whenNewVehicleCapacityIsNotSufficiant2_returnFalse(){
    Pickup service = (Pickup) createPickup("pick",2);
        Service serviceInRoute = createPickup("pick1",3);
        VehicleType type = VehicleTypeImpl.Builder.newInstance("type").addCapacityDimension(0,3).build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v").setType(type).setStartLocationId("loc").build();
        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addVehicle(vehicle).addJob(service).addJob(serviceInRoute).build();
        VehicleRoute route = VehicleRoute.Builder.newInstance(vehicle).setJobActivityFactory(vrp.getJobActivityFactory()).addService(serviceInRoute).build();
        stateManager.informInsertionStarts(Arrays.asList(route), null);
    JobInsertionContext iContext = new JobInsertionContext(route,service,vehicle,null,0.);
View Full Code Here

    @Before
    public void doBefore(){

        VehicleType type = VehicleTypeImpl.Builder.newInstance("type").setFixedCost(100.).setCostPerDistance(2.).addCapacityDimension(0, 15).build();

        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v1").setType(type)
                .setStartLocationCoordinate(Coordinate.newInstance(-5, 0))
                .addSkill("skill1").addSkill("skill2")
                .build();

        VehicleImpl vehicle2 = VehicleImpl.Builder.newInstance("v2").setType(type)
                .setStartLocationCoordinate(Coordinate.newInstance(5, 0)).build();

        Service s1 = Service.Builder.newInstance("s1")
                .setTimeWindow(TimeWindow.newInstance(10, 20))
                .setCoord(Coordinate.newInstance(-10, 1)).addSizeDimension(0, 2)
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.