示例#1
0
 public void RemoveNode(_Node node)
 {
     lock (AllNodesLock)
     {
         AllNodes.Remove(node);
     }
 }
示例#2
0
        public AbstractEdge(_Node node1, _Node node2)
        {
            Node1 = node1;
            Node2 = node2;

            HandleNeighbourhood();
        }
示例#3
0
        public List <IEdge> GetRelatedEdges(_Node node, out List <_Node> relatedNodes)
        {
            var edgesToBeRemoved = new List <IEdge>();

            relatedNodes = new List <_Node>();

            lock (AllEdgesLock)
            {
                // go through all edges, find the nodes and edges adjacent
                foreach (var edge in AllEdges)
                {
                    if (edge.GetNode1() == node)
                    {
                        edgesToBeRemoved.Add(edge);
                        relatedNodes.Add(edge.GetNode2());
                    }
                    else if (edge.GetNode2() == node)
                    {
                        edgesToBeRemoved.Add(edge);
                        relatedNodes.Add(edge.GetNode1());
                    }
                }
            }

            return(edgesToBeRemoved);
        }
示例#4
0
 public void UpdateNeighbour(_Node neighbour)
 {
     lock (NeighbourhoodLock)
     {
         Neighbours[neighbour.Id] = neighbour;
     }
 }
示例#5
0
 public void AddNeighbour(_Node node)
 {
     lock (NeighbourhoodLock)
     {
         Neighbours.Add(node.Id, node);
     }
 }
示例#6
0
 public void AddNode(_Node node)
 {
     lock (AllNodesLock)
     {
         NodeCount++;
         AllNodes.Add(node);
     }
 }
示例#7
0
 protected abstract void UpdateNeighbourInformation(_Node neighbour);
示例#8
0
 /// <summary>
 /// This method will be implemented for single initiation strategies.
 /// </summary>
 /// <param name="root"></param>
 public abstract void UserDefined_SingleInitiatorProcedure(_Node root);