Support Forum

Accessing previous node in TraversalProvider

Hi! I don’t think it is possible so I am writing in Feature Requests. It would be awesome to be able to access the previous node while making additional checks with TraversalProvider (for example when making sure that there is a connection between individual nodes for bigger size agents).

also I’ve tried to access Path as it should be provided in the traversal methods, i.e.

bool CanTraverse (Path path, GraphNode node);

But it does not contain any nodes.

I am using it with LayeredGridGraph with beta 4.3.26

@aron_granberg could you please take a look at this?

U need to change pathHandler to public in core

@Bito_Ishmael and what that does to do with my issue?

U want parent node of the path search, right?


        PathNode pn = path.pathHandler.GetPathNode(node);//.cost

        if(pn.parent == null)
            return cost;

        GraphNode prev = pn.parent.node;

Hi

Thanks for the suggestion.
In the next beta version you will be able to implement ITraversalProvider.CanTraverse(path, from, to) which allows you to get the functionality you need.

2 Likes

That’s great to hear! Thanks! Can’t wait for the updated version! :smiley:

1 Like