Пример #1
0
 private double transportCost(TourActivity activity) {
   return transportCost.getTransportCost(
       prevAct.getLocation(),
       activity.getLocation(),
       prevActDeparture,
       route.getDriver(),
       route.getVehicle());
 }
Пример #2
0
 private double calcDist(Service s_i, Service s_j) {
   double distance;
   try {
     distance = costs.getTransportCost(s_i.getLocation(), s_j.getLocation(), 0.0, null, null);
     return distance;
   } catch (IllegalStateException e) {
     // now try the euclidean distance between these two services
   }
   EuclideanServiceDistance euclidean = new EuclideanServiceDistance();
   distance = euclidean.getDistance(s_i, s_j);
   return distance;
 }