Ejemplo n.º 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;
        }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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))
 {
 }
Ejemplo n.º 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))
 {
 }
Ejemplo n.º 5
0
 protected static double HeuristicEstimateDistance(CurvesTopology top, int to, int y)
 {
     return(top.VertexAt(y).DistanceTo(top.VertexAt(to)));
 }
Ejemplo n.º 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)
 {
 }