The spaces
- class Euclidean(n_dim=1, coord_range=None, velocity=1)[source]
n-dimensional Euclidean space with constant velocity.
Initialize n-dimensional Euclidean space with constant velocity.
- Parameters:
- class Manhattan2D(coord_range=None, velocity=1)[source]
\(\mathbb{R}^2\) with \(L_1\)-induced metric (Manhattan).
- class Graph(vertices, edges, weights=None, velocity=1)[source]
A location is identified with a one-dimensional coordinate, namely the node index.
Weighted undirected graph with integer vertex labels
- Parameters:
weights (None | float | Sequence[float]) – Edge weights. - if None is supplied, the resulting graph is unweighted (unit edge length) - if a single float is supplied, every edge length will be equal to this number - if a sequence is supplied, this will be mapped onto the edge sequence
velocity (float) – constant velocity to compute travel time, optional.
- static _make_attribute_distance(G, attribute_name)[source]
Set the distance attribute on the edges of the graph inplace.
- Parameters:
G – The graph to modify
attribute_name (str | None) – The name of the attribute to use as distance. If None, the distance will be set to 1 for each edge.
- classmethod from_nx(G, velocity=1, make_attribute_distance='distance')[source]
Create a graph space from NetworkX graph.
- Parameters:
- Returns:
graph space instance