Exemple #1
0
    @Override
    public void visit(TourActivity activity) {
      // waiting time & toolate
      double waitAtAct = 0.;
      double tooLate = 0.;
      if (activityPolicy.equals(ActivityTimeTracker.ActivityPolicy.AS_SOON_AS_TIME_WINDOW_OPENS)) {
        waitAtAct =
            Math.max(
                0, activity.getTheoreticalEarliestOperationStartTime() - activity.getArrTime());
        tooLate =
            Math.max(0, activity.getArrTime() - activity.getTheoreticalLatestOperationStartTime());
      }
      sum_waiting_time += waitAtAct;
      sum_too_late += tooLate;
      // transport time
      double transportTime = activity.getArrTime() - prevActDeparture;
      sum_transport_time += transportTime;
      prevActDeparture = activity.getEndTime();
      // service time
      sum_service_time +=
          activityCosts.getActivityDuration(
              activity, activity.getArrTime(), route.getDriver(), route.getVehicle());

      stateManager.putActivityState(activity, transport_time_id, sum_transport_time);
    }
Exemple #2
0
 private double c(TourActivity from, TourActivity to, Vehicle vehicle) {
   return vrp.getTransportCosts()
       .getTransportCost(
           from.getLocation(),
           to.getLocation(),
           from.getEndTime(),
           DriverImpl.noDriver(),
           vehicle);
 }
Exemple #3
0
    @Override
    public void visit(TourActivity activity) {
      stateManager.putActivityState(activity, last_transport_distance_id, distance(activity));
      stateManager.putActivityState(activity, last_transport_time_id, transportTime(activity));
      stateManager.putActivityState(activity, last_transport_cost_id, transportCost(activity));

      prevAct = activity;
      prevActDeparture = activity.getEndTime();
    }