2024-08-02 04:27:56 +00:00
|
|
|
|
<a id="network-network-map-representation"></a>
|
2024-08-01 22:03:59 +00:00
|
|
|
|
|
2024-08-02 04:27:56 +00:00
|
|
|
|
# Network: Network map representation
|
2024-07-28 23:25:20 +00:00
|
|
|
|
|
|
|
|
|
### *class* Siph.map.Network(file=None)
|
|
|
|
|
|
|
|
|
|
Layered graph network
|
|
|
|
|
|
2024-08-01 22:03:59 +00:00
|
|
|
|
[🔗 Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/src/Siph/map.py)
|
2024-07-28 23:25:20 +00:00
|
|
|
|
|
|
|
|
|
#### omap
|
|
|
|
|
|
|
|
|
|
The outer network map of nodes
|
|
|
|
|
|
|
|
|
|
* **Type:**
|
|
|
|
|
nx.Graph
|
|
|
|
|
|
|
|
|
|
#### imap
|
|
|
|
|
|
|
|
|
|
The inner network map of peers
|
|
|
|
|
|
|
|
|
|
* **Type:**
|
|
|
|
|
nx.Graph
|
|
|
|
|
|
|
|
|
|
#### emaps
|
|
|
|
|
|
|
|
|
|
Extra network maps (TODO)
|
|
|
|
|
|
|
|
|
|
* **Type:**
|
|
|
|
|
list[nx.Graph]
|
|
|
|
|
|
|
|
|
|
#### lookup
|
|
|
|
|
|
|
|
|
|
Map of PierMesh node IDs to MeshTastic node IDs
|
|
|
|
|
|
|
|
|
|
* **Type:**
|
|
|
|
|
dict
|
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### *async* addLookup(onodeID: str, mnodeID: str)
|
2024-07-28 23:25:20 +00:00
|
|
|
|
|
|
|
|
|
Adds node to lookup
|
|
|
|
|
|
|
|
|
|
* **Parameters:**
|
|
|
|
|
* **onodeID** (*str*) – Internal nodeID
|
|
|
|
|
* **mnodeID** (*str*) – MeshTastic nodeID
|
|
|
|
|
|
|
|
|
|
#### addie(nodea: int, nodeb: int)
|
|
|
|
|
|
|
|
|
|
Add edge between peers on inner map
|
|
|
|
|
|
|
|
|
|
#### addin(id: int)
|
|
|
|
|
|
|
|
|
|
Add peer on inner map
|
|
|
|
|
|
2024-07-29 03:47:27 +00:00
|
|
|
|
* **Parameters:**
|
|
|
|
|
**id** (*int*) – PierMesh node ID
|
2024-07-28 23:25:20 +00:00
|
|
|
|
|
|
|
|
|
#### addoe(nodea: int, nodeb: int)
|
|
|
|
|
|
|
|
|
|
Add edge between nodes on outer map
|
|
|
|
|
|
|
|
|
|
#### addon(id: int)
|
|
|
|
|
|
|
|
|
|
Add node on outer map
|
|
|
|
|
|
2024-07-29 03:47:27 +00:00
|
|
|
|
* **Parameters:**
|
|
|
|
|
**id** (*int*) – PierMesh node ID
|
2024-07-28 23:25:20 +00:00
|
|
|
|
|
|
|
|
|
#### doLookup(onodeID: str)
|
|
|
|
|
|
|
|
|
|
Get MeshTastic ID from PierMesh ID
|
|
|
|
|
|
|
|
|
|
#### export(path: str)
|
|
|
|
|
|
|
|
|
|
Export network map to binary file (msgpack encoded)
|
|
|
|
|
|
|
|
|
|
#### path
|
|
|
|
|
|
|
|
|
|
File output path
|
|
|
|
|
|
|
|
|
|
* **Type:**
|
|
|
|
|
str
|
|
|
|
|
|
|
|
|
|
#### getRoute(senderNode: int, recipientNode: int)
|
|
|
|
|
|
|
|
|
|
Get the shortest route between two nodes on the outer map (Needs checkup)
|
|
|
|
|
|
|
|
|
|
#### mimport(path: str)
|
|
|
|
|
|
|
|
|
|
Import map from path
|
|
|
|
|
|
|
|
|
|
#### render(pathPrefix: str = '')
|
|
|
|
|
|
2024-07-29 03:47:27 +00:00
|
|
|
|
Render outer and inner network map to disk at the given path prefix
|
2024-11-26 17:43:02 +00:00
|
|
|
|
|
|
|
|
|
#### syncaddLookup(onodeID: str, mnodeID: str)
|
|
|
|
|
|
|
|
|
|
Adds node to lookup
|
|
|
|
|
|
|
|
|
|
* **Parameters:**
|
|
|
|
|
* **onodeID** (*str*) – Internal nodeID
|
|
|
|
|
* **mnodeID** (*str*) – MeshTastic nodeID
|