public Neighbour(CGraphNode cGraphNode, float cost) { node = cGraphNode; this.cost = cost; }
/// <summary> /// 添加邻接信息 /// </summary> /// <param name="cGraphNode">邻居节点</param> /// <param name="cost">到邻居的代价</param> public void AddNeighbour(CGraphNode cGraphNode, float cost) { Neighbours.Add(new Neighbour(cGraphNode, cost)); cGraphNode.Neighbours.Add(new Neighbour(this, cost)); }
/// <summary> /// 默认相邻点见成本为1的方法 /// </summary> /// <param name="cGraphNode"></param> public void AddNeighbour(CGraphNode cGraphNode) { AddNeighbour(cGraphNode, 1f); }
public void FillValue(float g, CGraphNode parent) { G = g; Parent = parent; }