Observation.next#
- Observation.next(vertex: Vertex) Vertex#
Return other end of an edge
- Parameters:
vertex (Vertex subclass) – one vertex on the edge
- Raises:
ValueError –
vertexis not on the edge- Returns:
the other vertex on the edge
- Return type:
Vertex subclass
e.next(v1)is the vertex at the other end of edgee, ie. the vertex that is notv1.>>> from pgraph import Vertex, Edge >>> v1 = Vertex(coord=[1,2], name="A") >>> v2 = Vertex(coord=[3,4], name="B") >>> e = Edge(v1, v2, cost=5.0, data="A to B") >>> print(e) Edge{[A] -- [B], cost=5} data=A to B >>> e.next(v1) Vertex[B, coord=(3, 4)] >>> e.next(v2) Vertex[A, coord=(1, 2)]