Example #1
0
    def adjacent_nodes(self, states, projections: ProjectionManager, graph: facility.SpatialGraph, geometry: LinkManager):
        for offset in projections.search_edge(self.anchor.idx + 1, self.edge, 0):
            yield LinkedNode.Key(self.edge, offset, self.anchor.idx + 1)

        distance = self.distance + self.link.length
        for next_edge in graph.adjacent(self.edge[1]):
            u, v, k = next_edge
            if (v, u, k) != self.edge:
                yield ForwardingNode.Key(self.anchor, distance, next_edge, self.projected_state)
Example #2
0
 def adjacent_nodes(self, graph: facility.SpatialGraph, goal: BoundNode):
     if goal.on(self.edge):
         yield goal
         return
     for next_edge in graph.adjacent(self.edge[1]):
         if goal.on(next_edge):
             yield Node(next_edge, 0.0, goal.edges[next_edge][0])
         else:
             yield Node(next_edge, 0.0, graph.edge_geometry(next_edge).length)
Example #3
0
    def adjacent_nodes(self, states, projections: ProjectionManager, graph: facility.SpatialGraph, geometry: LinkManager):
        if self.idx + 1 == len(states):
            yield FinalNode()
            return

        for offset in projections.search_edge(self.idx + 1, self.edge, self.offset):
            yield LinkedNode.Key(self.edge, offset, self.idx + 1)

        yield JumpingNode.Key(self)

        distance = self.link.length - self.segment.distance
        for next_edge in graph.adjacent(self.edge[1]):
            u, v, k = next_edge
            if (v, u) != self.edge:
                yield ForwardingNode.Key(self, distance, next_edge, self.next_projected_state)