private static IDictionary <ObjectiveType, double> WeightedSumShortestPathsObjectiveSelector( IWeightedDirectedPath <string, Edge> weightedDirectedPath ) { return(WeightedSumShortestPathsObjectiveSelector( weightedDirectedPath, weightedDirectedPath.Vertices.Count() )); }
private static IDictionary <ObjectiveType, double> WeightedSumShortestPathObjectiveSelector( IWeightedDirectedPath <string, Edge> weightedDirectedPath, int noOfEdges ) { return(new Dictionary <ObjectiveType, double> { { ObjectiveType.Comfortability, weightedDirectedPath.Weight.Comfortability / noOfEdges }, { ObjectiveType.Reliability, weightedDirectedPath.Weight.Reliability / noOfEdges } }); }
private static IDictionary <ObjectiveType, double> WeightedSumShortestPathsObjectiveSelector( IWeightedDirectedPath <string, Edge> weightedDirectedPath, int noOfEdges ) { return(new Dictionary <ObjectiveType, double> { { ObjectiveType.Time, weightedDirectedPath.Weight.Time.TotalMinutes }, { ObjectiveType.Distance, weightedDirectedPath.Weight.Distance }, { ObjectiveType.Comfortability, weightedDirectedPath.Weight.Comfortability / noOfEdges }, { ObjectiveType.Reliability, weightedDirectedPath.Weight.Reliability / noOfEdges }, { ObjectiveType.Connections, weightedDirectedPath.Edges.DistinctBy(edge => edge.Line).Count() - 1 } }); }