예제 #1
0
 /// <summary>
 /// add a node with the given Osm id
 /// </summary>
 /// <param name="tailNode"></param>
 public void addNode(Node tailNode)
 {
     if (tailNode != null)
     {
         long nodeId = tailNode.id;
         bool alreadyInNetwork = mapNodeId.ContainsKey(nodeId);
         if (!alreadyInNetwork)
         {
             mapNodeId.Add(nodeId,tailNode);
         }
     }
 }
예제 #2
0
 public void addEdge(Node headNode, Node tailNode, Arc arc)
 {
     if (tailNode != null && arc != null)
     {
         long tailNodeId = tailNode.id;
         if (!mapNodeId.ContainsKey(tailNodeId))
         {
             addNode(tailNode);
         }
         adjacentArcs.AddNode(headNode);
         adjacentArcs.AddNode(tailNode);
         adjacentArcs.AddEdge(headNode,tailNode);
     }
 }