Exemple #1
0
        /// <summary>
        /// Set up the search
        /// </summary>
        /// <param name="top">An input topology</param>
        /// <param name="dist">A series of distances. These cannot be less than the physical distance between starts and ends, but might be suitably longer</param>
        public PathMethod(CurvesTopology top, IList <double> dist)
        {
            if (top == null)
            {
                throw new ArgumentNullException("top");
            }
            m_top = top;

            if (dist == null)
            {
                throw new ArgumentNullException("dist");
            }
            if (dist.Count < m_top.EdgeLength)
            {
                throw new ArgumentOutOfRangeException("dist", "There should be one distance for each edge");
            }
            m_dist = dist;
        }
Exemple #2
0
 /// <summary>
 /// The Dijkstra algorithm.
 /// Each edge is given the length as set in "dist" parameter.
 /// </summary>
 /// <param name="top">An input topology</param>
 /// <param name="dist">A series of distances. These cannot be less than 0</param>
 public Dijkstra(CurvesTopology top, IList <double> dist) :
     base(top, dist)
 {
 }
Exemple #3
0
 /// <summary>
 /// The Dijkstra algorithm.
 /// Each edge is given length [value]. The graph is evaluated by link counts.
 /// </summary>
 /// <param name="top">An input topology</param>
 public Dijkstra(CurvesTopology top, double value) :
     this(top, new AlwaysFixed(value, top.EdgeLength))
 {
 }
Exemple #4
0
 /// <summary>
 /// The Dijkstra algorithm.
 /// Each edge is given length 1. The graph is evaluated by link counts.
 /// </summary>
 /// <param name="top">An input topology</param>
 public Dijkstra(CurvesTopology top) :
     this(top, new AlwaysFixed(1, top.EdgeLength))
 {
 }
Exemple #5
0
 protected static double HeuristicEstimateDistance(CurvesTopology top, int to, int y)
 {
     return(top.VertexAt(y).DistanceTo(top.VertexAt(to)));
 }
Exemple #6
0
 /// <summary>
 /// The A* search algorithm.
 /// See http://en.wikipedia.org/wiki/A*_search_algorithm for description.
 /// </summary>
 /// <param name="top">An input topology</param>
 /// <param name="dist">A series of distances. These cannot be less than the physical distance between starts and ends, but might be suitably longer</param>
 public AStar(CurvesTopology top, IList <double> dist) :
     base(top, dist)
 {
 }