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

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


     
      //pickup-tw
      String pickupTWStart = shipmentConfig.getString("pickup.timeWindows.timeWindow(0).start");
      String pickupTWEnd = shipmentConfig.getString("pickup.timeWindows.timeWindow(0).end");
      if(pickupTWStart != null && pickupTWEnd != null){
        TimeWindow pickupTW = TimeWindow.newInstance(Double.parseDouble(pickupTWStart), Double.parseDouble(pickupTWEnd));
        builder.setPickupTimeWindow(pickupTW);
      }

      //delivery-locationId
      String deliveryLocationId = shipmentConfig.getString("delivery.locationId");
      if(deliveryLocationId != null){
        builder.setDeliveryLocationId(deliveryLocationId);
      }
     
      //delivery-coord
      Coordinate deliveryCoord = getCoord(shipmentConfig,"delivery.");
      if(deliveryCoord != null){
        builder.setDeliveryCoord(deliveryCoord);
        if(deliveryLocationId != null){
//          vrpBuilder.addLocation(deliveryLocationId,deliveryCoord);
        }
        else{
//          vrpBuilder.addLocation(deliveryCoord.toString(),deliveryCoord);
          builder.setDeliveryLocationId(deliveryCoord.toString());
        }
      }

      //delivery-serviceTime
      String deliveryServiceTime = shipmentConfig.getString("delivery.duration");
      if(deliveryServiceTime != null) builder.setDeliveryServiceTime(Double.parseDouble(deliveryServiceTime));
     
      //delivery-tw
      String delTWStart = shipmentConfig.getString("delivery.timeWindows.timeWindow(0).start");
      String delTWEnd = shipmentConfig.getString("delivery.timeWindows.timeWindow(0).end");
      if(delTWStart != null && delTWEnd != null){
        TimeWindow delTW = TimeWindow.newInstance(Double.parseDouble(delTWStart), Double.parseDouble(delTWEnd));
        builder.setDeliveryTimeWindow(delTW);
      }

            //read skills
            String skillString = shipmentConfig.getString("requiredSkills");
View Full Code Here


@Ignore
public class TestDepartureTimeOpt {
 
  @Test
  public void whenSettingOneCustWithTWAnd_NO_DepTimeChoice_totalCostsShouldBe50(){
    TimeWindow timeWindow = TimeWindow.newInstance(40, 45);
    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
View Full Code Here

   
  }
 
  @Test
  public void whenSettingOneCustWithTWAnd_NO_DepTimeChoice_depTimeShouldBe0(){
    TimeWindow timeWindow = TimeWindow.newInstance(40, 45);
    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
View Full Code Here

   
  }
 
  @Test
  public void whenSettingOneCustWithTWAndDepTimeChoice_totalCostsShouldBe50(){
    TimeWindow timeWindow = TimeWindow.newInstance(40, 45);
    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
View Full Code Here

   
  }
 
  @Test
  public void whenSettingOneCustWithTWAndDepTimeChoice_depTimeShouldBe0(){
    TimeWindow timeWindow = TimeWindow.newInstance(40, 45);
    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
    Vehicle vehicle = VehicleImpl.Builder.newInstance("v").setStartLocationId("vehLoc").setStartLocationCoordinate(Coordinate.newInstance(0, 0))
        .setType(VehicleTypeImpl.Builder.newInstance("vType").build()).build();
   
    Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
View Full Code Here

   
  }
 
  @Test
  public void whenSettingTwoCustWithTWAndDepTimeChoice_totalCostsShouldBe50(){
    TimeWindow timeWindow = TimeWindow.newInstance(40, 45);
    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
   
    Service service2 = Service.Builder.newInstance("s2").setLocationId("servLoc2").setCoord(Coordinate.newInstance(0, 20)).
        setTimeWindow(TimeWindow.newInstance(30, 40)).build();
   
View Full Code Here

   
  }
 
  @Test
  public void whenSettingTwoCustWithTWAndDepTimeChoice_depTimeShouldBe10(){
    TimeWindow timeWindow = TimeWindow.newInstance(40, 45);
    Service service = Service.Builder.newInstance("s").setLocationId("servLoc").setCoord(Coordinate.newInstance(0, 10)).setTimeWindow(timeWindow).build();
   
    Service service2 = Service.Builder.newInstance("s2").setLocationId("servLoc2").setCoord(Coordinate.newInstance(0, 20)).
        setTimeWindow(TimeWindow.newInstance(30, 40)).build();
   
View Full Code Here

TOP

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

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.