Example #1
0
    private void CalcPathBetweenEntrances(EntrancePoint e1, EntrancePoint e2)
    {
        if (e1.AbstractId == e2.AbstractId)
        {
            return;
        }

        var tuple    = Tuple.Create(e1.AbstractId, e2.AbstractId);
        var invTuple = Tuple.Create(e2.AbstractId, e1.AbstractId);

        if (m_distanceDict.ContainsKey(tuple))
        {
            return;
        }

        PathPlanner planner = new PathPlanner(m_concreteMap, Area);
        Path        path    = planner.Search(e1.ConcreteNode, e2.ConcreteNode);

        if (path != null)
        {
            m_distanceDict[tuple] = m_distanceDict[invTuple] = path.Cost;

            m_pathDict[tuple] = new List <INode>();
            m_pathDict[tuple].AddRange(path.Nodes);

            path.Nodes.Reverse();
            m_pathDict[invTuple] = new List <INode>();
            m_pathDict[invTuple].AddRange(path.Nodes);
        }
    }
Example #2
0
 public void AddIntraEdgesData(EntrancePoint entrance)
 {
     foreach (var other in EntrancePoints)
     {
         CalcPathBetweenEntrances(entrance, other);
     }
 }
Example #3
0
    public EntrancePoint AddEntrancePoint(int abstractId, ConcreteNode node)
    {
        EntrancePoint point = new EntrancePoint(abstractId, node);

        EntrancePoints.Add(point);
        return(point);
    }
Example #4
0
 private int GetEntrancePointLevel(EntrancePoint point)
 {
     return(AbstractGraph.GetNode(point.AbstractId).Level);
 }