HPASharp.HierarchicalMap.AddEdge C# (CSharp) Method

AddEdge() public method

public AddEdge ( int sourceNodeId, int destNodeId, int cost, int level = 1, bool inter = false ) : void
sourceNodeId int
destNodeId int
cost int
level int
inter bool
return void
        public void AddEdge(int sourceNodeId, int destNodeId, int cost, int level = 1, bool inter = false)
        {
            AbstractGraph.AddEdge(sourceNodeId, destNodeId, new AbsTilingEdgeInfo(cost, level, inter));
        }

Usage Example

		public void RemoveAbstractNode(HierarchicalMap map, int nodeId, int stal)
		{
			var abstractGraph = map.AbstractGraph;

			if (m_stalUsed[stal])
			{
				// The node was an existing entrance point in the graph. Restore it with
				// the information we kept when inserting
				var nodeInfo = abstractGraph.GetNodeInfo(nodeId);
				nodeInfo.Level = m_stalLevel[stal];
				abstractGraph.RemoveEdgesFromNode(nodeId);
				abstractGraph.AddNode(nodeId, nodeInfo);
				foreach (var edge in m_stalEdges[stal])
				{
					var targetNodeId = edge.TargetNodeId;

					map.AddEdge(nodeId, targetNodeId, edge.Info.Cost,
							   edge.Info.Level, edge.Info.IsInterEdge);
					map.AddEdge(targetNodeId, nodeId, edge.Info.Cost,
							   edge.Info.Level, edge.Info.IsInterEdge);
				}
			}
			else
			{
				// Just delete the node from the graph
				var currentNodeInfo = abstractGraph.GetNodeInfo(nodeId);
				var clusterId = currentNodeInfo.ClusterId;
				var cluster = map.Clusters[clusterId];
				cluster.RemoveLastEntranceRecord();
				map.AbsNodeIds[currentNodeInfo.CenterId] = Constants.NO_NODE;
				abstractGraph.RemoveEdgesFromNode(nodeId);
				abstractGraph.RemoveLastNode();
			}
		}
All Usage Examples Of HPASharp.HierarchicalMap::AddEdge