コード例 #1
0
ファイル: SolutionAnalyser.java プロジェクト: sanga/jsprit
    @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);
    }
コード例 #2
0
ファイル: SolutionAnalyser.java プロジェクト: sanga/jsprit
 private double transportCost(TourActivity activity) {
   return transportCost.getTransportCost(
       prevAct.getLocation(),
       activity.getLocation(),
       prevActDeparture,
       route.getDriver(),
       route.getVehicle());
 }