Exemple #1
0
        public StopTimePathSearcher(IStopTimePathFinder pathFinder, Graph <int, StopTimeInfo> graph, Location source, Location destination)
        {
            _pathFinder = pathFinder ?? throw new ArgumentNullException(nameof(pathFinder));

            _graph      = graph ?? throw new ArgumentNullException(nameof(graph));
            Destination = destination ?? throw new ArgumentNullException(nameof(destination));
            Source      = source ?? throw new ArgumentNullException(nameof(source));

            // Set up source and destination nodes
            _referentialDestinationStop = graph.GetReferenceDestinationStop(Destination.Name);
            _sourceNodes = graph.GetSourceNodes(Source.Name, _referentialDestinationStop);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathProvider"/> class.
 /// </summary>
 /// <param name="pathFinder">The path finder.</param>
 /// <exception cref="ArgumentNullException">pathFinder</exception>
 public PathProvider(IStopTimePathFinder pathFinder)
 {
     _pathFinder = pathFinder ?? throw new ArgumentNullException(nameof(pathFinder));
 }