Tabnine Logo
TimeWindow.getStart
Code IndexAdd Tabnine to your IDE (free)

How to use
getStart
method
in
com.graphhopper.jsprit.core.problem.solution.route.activity.TimeWindow

Best Java code snippets using com.graphhopper.jsprit.core.problem.solution.route.activity.TimeWindow.getStart (Showing top 20 results out of 315)

origin: graphhopper/jsprit

public void add(TimeWindow timeWindow){
  for(TimeWindow tw : timeWindows){
    if(timeWindow.getStart() > tw.getStart() && timeWindow.getStart() < tw.getEnd()){
      throw new IllegalArgumentException("time-windows cannot overlap each other. overlap: " + tw + ", " + timeWindow);
    }
    if(timeWindow.getEnd() > tw.getStart() && timeWindow.getEnd() < tw.getEnd()){
      throw new IllegalArgumentException("time-windows cannot overlap each other. overlap: " + tw + ", " + timeWindow);
    }
    if(timeWindow.getStart() <= tw.getStart() && timeWindow.getEnd() >= tw.getEnd()){
      throw new IllegalArgumentException("time-windows cannot overlap each other. overlap: " + tw + ", " + timeWindow);
    }
  }
  timeWindows.add(timeWindow);
}
origin: graphhopper/jsprit

public Builder addPickup(Shipment shipment, TimeWindow pickupTimeWindow) {
  if (openShipments.contains(shipment))
    throw new IllegalArgumentException("shipment has already been added. cannot add it twice.");
  List<AbstractActivity> acts = jobActivityFactory.createActivities(shipment);
  TourActivity act = acts.get(0);
  act.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart());
  act.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd());
  tourActivities.addActivity(act);
  openShipments.add(shipment);
  openActivities.put(shipment, acts.get(1));
  return this;
}
origin: graphhopper/jsprit

public Builder addDelivery(Shipment shipment, TimeWindow deliveryTimeWindow) {
  if (openShipments.contains(shipment)) {
    TourActivity act = openActivities.get(shipment);
    act.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart());
    act.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd());
    tourActivities.addActivity(act);
    openShipments.remove(shipment);
  } else {
    throw new IllegalArgumentException("cannot deliver shipment. shipment " + shipment + " needs to be picked up first.");
  }
  return this;
}
origin: graphhopper/jsprit

public Builder addService(Service service, TimeWindow timeWindow) {
  if (service == null) throw new IllegalArgumentException("service must not be null");
  List<AbstractActivity> acts = jobActivityFactory.createActivities(service);
  TourActivity act = acts.get(0);
  act.setTheoreticalEarliestOperationStartTime(timeWindow.getStart());
  act.setTheoreticalLatestOperationStartTime(timeWindow.getEnd());
  tourActivities.addActivity(act);
  return this;
}
origin: graphhopper/jsprit

public static void main(String[] args) {
  VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
  new LopezIbanezBlumReader(builder).read("input/Dumas/n20w20.001.txt");
  VehicleRoutingProblem vrp = builder.build();
  System.out.println("0->1: " + vrp.getTransportCosts().getTransportCost(Location.newInstance(0), Location.newInstance(1), 0, null, null));
  System.out.println("0->20: " + vrp.getTransportCosts().getTransportCost(Location.newInstance(0), Location.newInstance(20), 0, null, null));
  System.out.println("4->18: " + vrp.getTransportCosts().getTransportCost(Location.newInstance(4), Location.newInstance(18), 0, null, null));
  System.out.println("20->8: " + vrp.getTransportCosts().getTransportCost(Location.newInstance(20), Location.newInstance(8), 0, null, null));
  System.out.println("18: " + ((Service) vrp.getJobs().get("" + 18)).getTimeWindow().getStart() + " " + ((Service) vrp.getJobs().get("" + 18)).getTimeWindow().getEnd());
  System.out.println("20: " + ((Service) vrp.getJobs().get("" + 20)).getTimeWindow().getStart() + " " + ((Service) vrp.getJobs().get("" + 20)).getTimeWindow().getEnd());
  System.out.println("1: " + ((Service) vrp.getJobs().get("" + 1)).getTimeWindow().getStart() + " " + ((Service) vrp.getJobs().get("" + 1)).getTimeWindow().getEnd());
}
origin: graphhopper/jsprit

private Builder addBreakInternally(Break currentBreak, TimeWindow timeWindow, Location breakLocation) {
  List<AbstractActivity> acts = jobActivityFactory.createActivities(currentBreak);
  BreakActivity act = (BreakActivity) acts.get(0);
  act.setTheoreticalEarliestOperationStartTime(timeWindow.getStart());
  act.setTheoreticalLatestOperationStartTime(timeWindow.getEnd());
  act.setLocation(breakLocation);
  tourActivities.addActivity(act);
  return this;
}
origin: graphhopper/jsprit

private double scoreService(InsertionData best, Job job) {
  Location location = ((Service) job).getLocation();
  double maxDepotDistance = 0;
  if (location != null) {
    maxDepotDistance = Math.max(
      getDistance(best.getSelectedVehicle().getStartLocation(), location),
      getDistance(best.getSelectedVehicle().getEndLocation(), location)
    );
  }
  return Math.max(timeWindowParam * (((Service) job).getTimeWindow().getEnd() - ((Service) job).getTimeWindow().getStart()), minTimeWindowScore) +
    depotDistanceParam * maxDepotDistance;
}
origin: graphhopper/jsprit

private double scoreShipment(InsertionData best, Job job) {
  Shipment shipment = (Shipment) job;
  double maxDepotDistance_1 = Math.max(
    getDistance(best.getSelectedVehicle().getStartLocation(), shipment.getPickupLocation()),
    getDistance(best.getSelectedVehicle().getStartLocation(), shipment.getDeliveryLocation())
  );
  double maxDepotDistance_2 = Math.max(
    getDistance(best.getSelectedVehicle().getEndLocation(), shipment.getPickupLocation()),
    getDistance(best.getSelectedVehicle().getEndLocation(), shipment.getDeliveryLocation())
  );
  double maxDepotDistance = Math.max(maxDepotDistance_1, maxDepotDistance_2);
  double minTimeToOperate = Math.min(shipment.getPickupTimeWindow().getEnd() - shipment.getPickupTimeWindow().getStart(),
    shipment.getDeliveryTimeWindow().getEnd() - shipment.getDeliveryTimeWindow().getStart());
  return Math.max(timeWindowParam * minTimeToOperate, minTimeWindowScore) + depotDistanceParam * maxDepotDistance;
}
origin: graphhopper/jsprit

    deliveryAct2Insert.setTheoreticalEarliestOperationStartTime(timeWindow.getStart());
    deliveryAct2Insert.setTheoreticalLatestOperationStartTime(timeWindow.getEnd());
    ActivityContext activityContext = new ActivityContext();
deliveryAct2Insert.setTheoreticalEarliestOperationStartTime(bestTimeWindow.getStart());
deliveryAct2Insert.setTheoreticalLatestOperationStartTime(bestTimeWindow.getEnd());
insertionData.getEvents().add(new InsertActivity(currentRoute, newVehicle, deliveryAct2Insert, insertionIndex));
origin: graphhopper/jsprit

    pickupShipment.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart());
    pickupShipment.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd());
    ActivityContext activityContext = new ActivityContext();
        deliverShipment.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart());
        deliverShipment.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd());
        ActivityContext activityContext_ = new ActivityContext();
pickupShipment.setTheoreticalEarliestOperationStartTime(bestPickupTimeWindow.getStart());
pickupShipment.setTheoreticalLatestOperationStartTime(bestPickupTimeWindow.getEnd());
deliverShipment.setTheoreticalEarliestOperationStartTime(bestDeliveryTimeWindow.getStart());
deliverShipment.setTheoreticalLatestOperationStartTime(bestDeliveryTimeWindow.getEnd());
insertionData.setVehicleDepartureTime(newVehicleDepartureTime);
origin: graphhopper/jsprit

    boolean pickupInsertionNotFulfilledBreak = true;
    for (TimeWindow pickupTimeWindow : shipment.getPickupTimeWindows()) {
      pickupShipment.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart());
      pickupShipment.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd());
      ActivityContext activityContext = new ActivityContext();
          boolean deliveryInsertionNotFulfilledBreak = true;
          for (TimeWindow deliveryTimeWindow : shipment.getDeliveryTimeWindows()) {
            deliverShipment.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart());
            deliverShipment.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd());
            ActivityContext activityContext_ = new ActivityContext();
pickupShipment.setTheoreticalEarliestOperationStartTime(bestPickupTimeWindow.getStart());
pickupShipment.setTheoreticalLatestOperationStartTime(bestPickupTimeWindow.getEnd());
deliverShipment.setTheoreticalEarliestOperationStartTime(bestDeliveryTimeWindow.getStart());
deliverShipment.setTheoreticalLatestOperationStartTime(bestDeliveryTimeWindow.getEnd());
insertionData.setVehicleDepartureTime(newVehicleDepartureTime);
origin: graphhopper/jsprit

for (Location location : locations) {
  breakAct2Insert.setLocation(location);
  breakAct2Insert.setTheoreticalEarliestOperationStartTime(breakToInsert.getTimeWindow().getStart());
  breakAct2Insert.setTheoreticalLatestOperationStartTime(breakToInsert.getTimeWindow().getEnd());
  ConstraintsStatus status = hardActivityLevelConstraint.fulfilled(insertionContext, prevAct, breakAct2Insert, nextAct, prevActStartTime);
origin: com.graphhopper/jsprit-core

public Builder addDelivery(Shipment shipment, TimeWindow deliveryTimeWindow) {
  if (openShipments.contains(shipment)) {
    TourActivity act = openActivities.get(shipment);
    act.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart());
    act.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd());
    tourActivities.addActivity(act);
    openShipments.remove(shipment);
  } else {
    throw new IllegalArgumentException("cannot deliver shipment. shipment " + shipment + " needs to be picked up first.");
  }
  return this;
}
origin: com.graphhopper/jsprit-core

public Builder addService(Service service, TimeWindow timeWindow) {
  if (service == null) throw new IllegalArgumentException("service must not be null");
  List<AbstractActivity> acts = jobActivityFactory.createActivities(service);
  TourActivity act = acts.get(0);
  act.setTheoreticalEarliestOperationStartTime(timeWindow.getStart());
  act.setTheoreticalLatestOperationStartTime(timeWindow.getEnd());
  tourActivities.addActivity(act);
  return this;
}
origin: graphhopper/jsprit

xmlConfig.setProperty(shipmentPathString + "(" + counter + ").pickup.duration", shipment.getPickupServiceTime());
for(TimeWindow tw : pu_tws) {
  xmlConfig.setProperty(shipmentPathString + "(" + counter + ").pickup.timeWindows.timeWindow(" + index + ").start", tw.getStart());
  xmlConfig.setProperty(shipmentPathString + "(" + counter + ").pickup.timeWindows.timeWindow(" + index + ").end", tw.getEnd());
  ++index;
index = 0;
for(TimeWindow tw : del_tws) {
  xmlConfig.setProperty(shipmentPathString + "(" + counter + ").delivery.timeWindows.timeWindow(" + index + ").start", tw.getStart());
  xmlConfig.setProperty(shipmentPathString + "(" + counter + ").delivery.timeWindows.timeWindow(" + index + ").end", tw.getEnd());
  ++index;
origin: graphhopper/jsprit

xmlConfig.setProperty(shipmentPathString + "(" + counter + ").duration", service.getServiceDuration());
for(TimeWindow tw : tws) {
  xmlConfig.setProperty(shipmentPathString + "(" + counter + ").timeWindows.timeWindow(" + index + ").start", tw.getStart());
  xmlConfig.setProperty(shipmentPathString + "(" + counter + ").timeWindows.timeWindow(" + index + ").end", tw.getEnd());
  ++index;
origin: com.graphhopper/jsprit-core

private Builder addBreakInternally(Break currentBreak, TimeWindow timeWindow, Location breakLocation) {
  List<AbstractActivity> acts = jobActivityFactory.createActivities(currentBreak);
  BreakActivity act = (BreakActivity) acts.get(0);
  act.setTheoreticalEarliestOperationStartTime(timeWindow.getStart());
  act.setTheoreticalLatestOperationStartTime(timeWindow.getEnd());
  act.setLocation(breakLocation);
  tourActivities.addActivity(act);
  return this;
}
origin: com.graphhopper/jsprit-core

private double scoreService(InsertionData best, Job job) {
  Location location = ((Service) job).getLocation();
  double maxDepotDistance = 0;
  if (location != null) {
    maxDepotDistance = Math.max(
      getDistance(best.getSelectedVehicle().getStartLocation(), location),
      getDistance(best.getSelectedVehicle().getEndLocation(), location)
    );
  }
  return Math.max(timeWindowParam * (((Service) job).getTimeWindow().getEnd() - ((Service) job).getTimeWindow().getStart()), minTimeWindowScore) +
    depotDistanceParam * maxDepotDistance;
}
origin: graphhopper/jsprit

xmlConfig.setProperty(vehiclePathString + "(" + counter + ").breaks.duration", vehicle.getBreak().getServiceDuration());
for(TimeWindow tw : tws) {
  xmlConfig.setProperty(vehiclePathString + "(" + counter + ").breaks.timeWindows.timeWindow(" + index + ").start", tw.getStart());
  xmlConfig.setProperty(vehiclePathString + "(" + counter + ").breaks.timeWindows.timeWindow(" + index + ").end", tw.getEnd());
  ++index;
origin: matsim-org/matsim

static CarrierService createCarrierService(Service service) {
  CarrierService.Builder serviceBuilder = CarrierService.Builder.newInstance(Id.create(service.getId(), CarrierService.class), Id.create(service.getLocation().getId(), Link.class));
  serviceBuilder.setCapacityDemand(service.getSize().get(0));
  serviceBuilder.setServiceDuration(service.getServiceDuration());
  serviceBuilder.setServiceStartTimeWindow(TimeWindow.newInstance(service.getTimeWindow().getStart(), service.getTimeWindow().getEnd()));
  return serviceBuilder.build();
}

com.graphhopper.jsprit.core.problem.solution.route.activityTimeWindowgetStart

Javadoc

Returns startTime of TimeWindow.

Popular methods of TimeWindow

  • getEnd
    Returns endTime of TimeWindow.
  • newInstance
    Returns new instance of TimeWindow.
  • <init>
    Constructs the timeWindow

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSupportFragmentManager (FragmentActivity)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now