using HeuristicLab.Problems.RoutePlanning.Data.Core; using HeuristicLab.Problems.RoutePlanning.Interfaces; using HeuristicLab.Problems.RoutePlanning.Utilities; namespace HeuristicLab.Problems.RoutePlanning.RoutingGraph { public class EarthDistanceCostCalculator : ICostCalculator { #region ICostCalculator Members public float Costs(Edge edge) { return edge.Weight; } public float CalculateCosts(Vertex source, Vertex destination, HighwayType category) { double distanceKms = Utils.LocationDistance(source.Logitude, source.Latitude, destination.Logitude, destination.Latitude); double weight = distanceKms; return (float)weight; } public float EstimatedCosts(Vertex source, Vertex destination) { double distanceKms = Utils.LocationDistance(source.Logitude, source.Latitude, destination.Logitude, destination.Latitude); double weight = distanceKms; return (float)weight; } #endregion } }