private static void BuildRoute(IList<TransitEdge> currentPath, string destinationNode, IEnumerable<TransitEdge> edges, Constraints constraints, ICollection<TransitPath> paths)
 {
    var currentEdge = currentPath.Last();
    if (currentEdge.To == destinationNode)
    {
       var path = new TransitPath(currentPath);
       paths.Add(path);
       return;
    }
    var possibleEdges = FindPossibleEdges(currentEdge.To, currentEdge.ToDate, edges, constraints);
    foreach (var possibleEdge in possibleEdges)
    {
       var newPath = new List<TransitEdge>(currentPath) {possibleEdge};
       BuildRoute(newPath, destinationNode,edges, constraints, paths);
    }
 }
        private static void BuildRoute(IList <TransitEdge> currentPath, string destinationNode, IEnumerable <TransitEdge> edges, Constraints constraints, ICollection <TransitPath> paths)
        {
            var currentEdge = currentPath.Last();

            if (currentEdge.To == destinationNode)
            {
                var path = new TransitPath(currentPath);
                paths.Add(path);
                return;
            }
            var possibleEdges = FindPossibleEdges(currentEdge.To, currentEdge.ToDate, edges, constraints);

            foreach (var possibleEdge in possibleEdges)
            {
                var newPath = new List <TransitEdge>(currentPath)
                {
                    possibleEdge
                };
                BuildRoute(newPath, destinationNode, edges, constraints, paths);
            }
        }
Beispiel #3
0
 private static RouteCandidateDTO ToRouteCandidate(TransitPath path)
 {
    return new RouteCandidateDTO {Legs = path.Edges.Select(x => ToLeg(x)).ToList()};
 }
 private Itinerary ToItinerary(TransitPath path)
 {
    return new Itinerary(path.Edges.Select(x => ToLeg(x)));
 }
 private Itinerary ToItinerary(TransitPath path)
 {
    return new Itinerary(CreateLegs(path.Edges));
 }