/// <summary> /// Creates an instance of the <see cref="Dijkstra"/> class. /// </summary> /// <param name="totalNodeCount"> /// The total number of nodes in the graph. /// </param> /// <param name="traversalCost"> /// The delegate that can provide the cost of a transition between /// any two nodes. /// </param> /// <param name="hint"> /// An optional delegate that can provide a small subset of nodes /// that a given nodeIndex may be connected to. /// </param> public Dijkstra(int totalNodeCount, InternodeTraversalCost traversalCost, NearbyNodesHint hint) { if (totalNodeCount < 3) throw new ArgumentOutOfRangeException("totalNodeCount " + totalNodeCount + " Expected a minimum of 3."); if (traversalCost == null) throw new ArgumentNullException("traversalCost"); Hint = hint; TraversalCost = traversalCost; TotalNodeCount = totalNodeCount; }
public Dijkstra(List<NetUser> netUserList, NetLayer.NetData _netData) { if (netUserList.Count < 3) throw new ArgumentOutOfRangeException("totalNodeCount " + netUserList.Count + "Expected a minimum of 3."); this.netUserList = netUserList; Hint = getConnectedNodesNetuSer; TraversalCost = getCostNetUser; TotalNodeCount = this.netUserList.Count; netData = _netData; }
/// <summary> /// Creates an instance of the <see cref="Dijkstra"/> class. /// </summary> /// <param name="totalNodeCount"> /// The total number of nodes in the graph. /// </param> /// <param name="traversalCost"> /// The delegate that can provide the cost of a transition between /// any two nodes. /// </param> /// <param name="hint"> /// An optional delegate that can provide a small subset of nodes /// that a given nodeIndex may be connected to. /// </param> public Dijkstra(int totalNodeCount, InternodeTraversalCost traversalCost, NearbyNodesHint hint) { if (totalNodeCount < 3) { throw new ArgumentOutOfRangeException("totalNodeCount", totalNodeCount, "Expected a minimum of 3."); } if (traversalCost == null) { throw new ArgumentNullException("traversalCost"); } Hint = hint; TraversalCost = traversalCost; TotalNodeCount = totalNodeCount; }