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);
            }
        }
Esempio n. 3
0
 private static RouteCandidateDTO ToRouteCandidate(TransitPath path)
 {
    return new RouteCandidateDTO {Legs = path.Edges.Select(x => ToLeg(x)).ToList()};
 }
Esempio n. 4
0
 private Itinerary ToItinerary(TransitPath path)
 {
    return new Itinerary(path.Edges.Select(x => ToLeg(x)));
 }
Esempio n. 5
0
 private Itinerary ToItinerary(TransitPath path)
 {
    return new Itinerary(CreateLegs(path.Edges));
 }