Package jsprit.core.problem.vehicle

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


    }

    public void buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore(){
        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))
                .setLatestArrival(150.)
                .build();

        Pickup s1 = (Pickup) Pickup.Builder.newInstance("s1")
View Full Code Here


    @Test
    public void solutionWithoutUnassignedJobsShouldBeWrittenCorrectly(){
        Builder builder = VehicleRoutingProblem.Builder.newInstance();

        VehicleTypeImpl type1 = VehicleTypeImpl.Builder.newInstance("vehType").addCapacityDimension(0, 20).build();
        VehicleImpl v1 = VehicleImpl.Builder.newInstance("v1").setStartLocationId("loc").setType(type1).build();
        builder.addVehicle(v1);

        Service s1 = Service.Builder.newInstance("1").addSizeDimension(0, 1).setLocationId("loc").setServiceTime(2.0).build();
        Service s2 = Service.Builder.newInstance("2").addSizeDimension(0, 1).setLocationId("loc2").setServiceTime(4.0).build();
View Full Code Here

    @Test
    public void solutionWithUnassignedJobsShouldBeWrittenCorrectly(){
        Builder builder = VehicleRoutingProblem.Builder.newInstance();

        VehicleTypeImpl type1 = VehicleTypeImpl.Builder.newInstance("vehType").addCapacityDimension(0, 20).build();
        VehicleImpl v1 = VehicleImpl.Builder.newInstance("v1").setStartLocationId("loc").setType(type1).build();
        builder.addVehicle(v1);

        Service s1 = Service.Builder.newInstance("1").addSizeDimension(0, 1).setLocationId("loc").setServiceTime(2.0).build();
        Service s2 = Service.Builder.newInstance("2").addSizeDimension(0, 1).setLocationId("loc2").setServiceTime(4.0).build();
View Full Code Here

    private StateManager stateManager;

    @Before
    public void doBefore(){
        VehicleType type = VehicleTypeImpl.Builder.newInstance("t").build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("start").setType(type).build();
        Service service = Service.Builder.newInstance("s").setLocationId("loc").addRequiredSkill("skill1").build();
        Service service2 = Service.Builder.newInstance("s2").setLocationId("loc").addRequiredSkill("skill1").addRequiredSkill("skill2").addRequiredSkill("skill3").build();
        Service service3 = Service.Builder.newInstance("s3").setLocationId("loc").addRequiredSkill("skill4").addRequiredSkill("skill5").build();
        VehicleRoutingProblem vrp = VehicleRoutingProblem.Builder.newInstance().addVehicle(vehicle).addJob(service)
                .addJob(service2).addJob(service3).build();
View Full Code Here

        }
        close(reader);
        vrpBuilder.setFleetSize(VehicleRoutingProblem.FleetSize.INFINITE);
        for(Integer depotId : depotIds){
            VehicleTypeImpl type = VehicleTypeImpl.Builder.newInstance("typeId").addCapacityDimension(0,capacity).build();
            VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle").setStartLocationId(depotId.toString())
                    .setStartLocationCoordinate(coords[depotId - 1]).setType(type).build();
            vrpBuilder.addVehicle(vehicle);
        }
        for(int i=0;i<demands.length;i++){
            if(demands[i] == 0) continue;
View Full Code Here

        //two vehicles: v1 - skill1 #5; v2 - skill2 #6
        Vehicle solomonVehicle = vrp.getVehicles().iterator().next();
        VehicleType newType = solomonVehicle.getType();
        VehicleRoutingProblem.Builder skillProblemBuilder = VehicleRoutingProblem.Builder.newInstance();
        for(int i=0;i<6;i++) {
            VehicleImpl skill1Vehicle = VehicleImpl.Builder.newInstance("skill1_vehicle_"+i).addSkill("skill1")
                    .setStartLocationCoordinate(solomonVehicle.getStartLocationCoordinate()).setStartLocationId(solomonVehicle.getStartLocationId())
                    .setEarliestStart(solomonVehicle.getEarliestDeparture())
                    .setType(newType).build();
            VehicleImpl skill2Vehicle = VehicleImpl.Builder.newInstance("skill2_vehicle_"+i).addSkill("skill2")
                    .setStartLocationCoordinate(solomonVehicle.getStartLocationCoordinate()).setStartLocationId(solomonVehicle.getStartLocationId())
                    .setEarliestStart(solomonVehicle.getEarliestDeparture())
                    .setType(newType).build();
            skillProblemBuilder.addVehicle(skill1Vehicle).addVehicle(skill2Vehicle);
        }
View Full Code Here

    }

    @Test
    public void maxCapacityShouldNotBeExceeded(){
        VehicleType type = VehicleTypeImpl.Builder.newInstance("type").addCapacityDimension(0, 100).build();
        VehicleImpl vehicle = VehicleImpl.Builder.newInstance("veh").setStartLocationCoordinate(Coordinate.newInstance(0, 0)).setType(type).setStartLocationId("start").build();

        Shipment shipment = Shipment.Builder.newInstance("s").setPickupLocationId("pick").setDeliveryLocationId("del").setPickupCoord(Coordinate.newInstance(10, 0))
                .setDeliveryCoord(Coordinate.newInstance(0, 10)).addSizeDimension(0, 100).build();

        Shipment another_shipment = Shipment.Builder.newInstance("another_s").setPickupLocationId("pick").setDeliveryLocationId("del").setPickupCoord(Coordinate.newInstance(10, 0))
View Full Code Here

        double latestArrTime = 0.0;
        Coordinate coord = null;
        String typeId = null;
        for(Builder vBuilder : vBuilders){
          vBuilder.setStartLocationCoordinate(depotCoord);
          VehicleImpl vehicle = vBuilder.build();
          cap = vehicle.getType().getCapacityDimensions();
          typeId = vehicle.getType().getTypeId();
          latestArrTime = vehicle.getLatestArrival();
          coord = vehicle.getStartLocationCoordinate();
          vrpBuilder.addVehicle(vehicle);
        }
        if(addPenaltyVehicles){
          VehicleTypeImpl penaltyType = VehicleTypeImpl.Builder.newInstance(typeId).setCapacityDimensions(cap).setCostPerDistance(3.0).setFixedCost(50).build();
          VehicleImpl penaltyVehicle = VehicleImpl.Builder.newInstance(counter + "_penaltyVehicle").setLatestArrival(latestArrTime)
              .setType(new PenaltyVehicleType(penaltyType)).setStartLocationCoordinate(coord).build();
          vrpBuilder.addVehicle(penaltyVehicle);
        }
        depotCounter++;
      }
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

        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.