Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/20 16:55:51 (4 years ago)
Author:
abeham
Message:

#2521: Unified architecture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs

    r17529 r17533  
    9696    }
    9797    public static double CalculateTravelCosts(IOrienteeringProblemData data, IntegerVector solution) {
    98       var distance = data.RoutingData.GetPathDistance(solution, closed: false);
     98      var distance = data.GetPathDistance(solution, closed: false);
    9999      distance += (solution.Length - 2) * data.PointVisitingCosts;
    100100      return distance;
    101101    }
    102102    public static double CalculateTravelCosts(IOrienteeringProblemData data, IList<int> solution) {
    103       var distance = data.RoutingData.GetPathDistance(solution, closed: false);
     103      var distance = data.GetPathDistance(solution, closed: false);
    104104      distance += (solution.Count - 2) * data.PointVisitingCosts;
    105105      return distance;
     
    127127    }
    128128    public static double CalculateInsertionCosts(IOrienteeringProblemData data, IList<int> path, int insertPosition, int point) {
    129       double detour = data.RoutingData.GetDistance(path[insertPosition - 1], point) + data.RoutingData.GetDistance(point, path[insertPosition]);
     129      double detour = data.GetDistance(path[insertPosition - 1], point) + data.GetDistance(point, path[insertPosition]);
    130130      detour += data.PointVisitingCosts;
    131       detour -= data.RoutingData.GetDistance(path[insertPosition - 1], path[insertPosition]);
     131      detour -= data.GetDistance(path[insertPosition - 1], path[insertPosition]);
    132132      return detour;
    133133    }
    134134    public static double CalculateReplacementCosts(IOrienteeringProblemData data, IList<int> path, int replacePosition, int point) {
    135       double detour = data.RoutingData.GetDistance(path[replacePosition - 1], point) + data.RoutingData.GetDistance(point, path[replacePosition + 1]);
    136       detour -= data.RoutingData.GetDistance(path[replacePosition - 1], path[replacePosition]) + data.RoutingData.GetDistance(path[replacePosition], path[replacePosition + 1]);
     135      double detour = data.GetDistance(path[replacePosition - 1], point) + data.GetDistance(point, path[replacePosition + 1]);
     136      detour -= data.GetDistance(path[replacePosition - 1], path[replacePosition]) + data.GetDistance(path[replacePosition], path[replacePosition + 1]);
    137137      return detour;
    138138    }
    139139    public static double CalculateRemovementSaving(IOrienteeringProblemData data, IList<int> path, int removePosition) {
    140       double saving = data.RoutingData.GetDistance(path[removePosition - 1], path[removePosition]);
    141       saving += data.RoutingData.GetDistance(path[removePosition], path[removePosition + 1]);
    142       saving -= data.RoutingData.GetDistance(path[removePosition - 1], path[removePosition + 1]);
     140      double saving = data.GetDistance(path[removePosition - 1], path[removePosition]);
     141      saving += data.GetDistance(path[removePosition], path[removePosition + 1]);
     142      saving -= data.GetDistance(path[removePosition - 1], path[removePosition + 1]);
    143143      saving += data.PointVisitingCosts;
    144144      return saving;
Note: See TracChangeset for help on using the changeset viewer.