public void AddPredecessor(IReactiveNode node)
 {
     ValidatePredecessor(node);
     if (Predecessors.Contains(node) == false)
     {
         Predecessors.Add(node);
     }
 }
예제 #2
0
 private void FindShortestDistance(Node node)
 {
     var adjNodes = GetNeighbors(node);
     foreach (var target in adjNodes)
     {
         if (GetShortestDistance(target) > GetShortestDistance(node) + GetDistance(node, target))
         {
             Distance.Add(target, GetShortestDistance(node) + GetDistance(node, target));
             Predecessors.Add(target, node);
             UnSettledNodes.Add(target);
         }
     }
 }