Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to get the subgraph that was matched to the subtrajectory? #12

Open
Erfanh1995 opened this issue Jan 12, 2021 · 3 comments

Comments

@Erfanh1995
Copy link

Looking through the code it seems like it returns the subtrajectory that matches the graph. Is there any way to get the matched part from the graph instead?

@wannesm
Copy link
Owner

wannesm commented Jan 12, 2021

It returns the ids of the nodes that are matched, which is the matched part of the graph. But maybe I don't understand the question correctly?

@Erfanh1995
Copy link
Author

In the non-emitting example, for instance, you get two outputs, nodes and states. The nodes are the nodes from the graph and the states are from the trajectory? What I'm trying to get is the light blue edges that are matched in this picture

@wannesm
Copy link
Owner

wannesm commented Jan 14, 2021

For that, you can look at the matcher.lattice_best property. This is a list of all the matches. This is not only nodes because, as shown in the graph, it also matches on the segment in between two nodes. Each lattice entry is a matcher object that has an edge_m and edge_o object (resp the matched nodes and observed points). And each of these objects are of the Segment type and have a pi property that is the interpolated point (if it is interpolated, otherwise it is the start or end point of the segment and thus a node in the graph).

You can also look at that part in the visualisation code to see it in action:

if matcher and show_matching:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants