Exemple #1
0
 /// <summary>
 /// Creates a new one-to-all dykstra algorithm instance.
 /// </summary>
 public DirectedDykstra(Graph graph, WeightHandler <T> weightHandler, RestrictionCollection restrictions,
                        DirectedDykstraSource <T> source, T sourceMax, bool backward)
 {
     _graph         = graph;
     _source        = source;
     _weightHandler = weightHandler;
     _sourceMax     = sourceMax;
     _backward      = backward;
     _restrictions  = restrictions;
 }
 /// <summary>
 /// Creates a new many-to-many algorithm instance.
 /// </summary>
 public DirectedOneToManyWeights(Graph graph, WeightHandler <T> weightHandler, RestrictionCollection restrictions,
                                 DirectedDykstraSource <T> source, DirectedDykstraSource <T>[] targets, T maxSearch)
 {
     _graph         = graph;
     _source        = source;
     _targets       = targets;
     _weightHandler = weightHandler;
     _maxSearch     = maxSearch;
     _restrictions  = restrictions;
 }
        /// <summary>
        /// Converts the router points to a directed dykstra source.
        /// </summary>
        /// <param name="routerDb">The routerDb.</param>
        /// <param name="forward">The forward flag.</param>
        /// <param name="weightHandler">The weight handler.</param>
        public static DirectedDykstraSource <T>[] ToDirectedDykstraSources <T>(this RouterPoint[] points, bool forward, RouterDb routerDb, WeightHandler <T> weightHandler)
            where T : struct
        {
            var results = new DirectedDykstraSource <T> [points.Length];

            for (var i = 0; i < points.Length; i++) // TODO: this only reads stuff, perfect to parallelise
            {
                results[i] = points[i].ToDirectedDykstraSource(forward, routerDb, weightHandler);
            }
            return(results);
        }