piermesh/docs/Siph/map.md

103 lines
1.7 KiB
Markdown
Raw Normal View History

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
### *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)
#### 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)
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
#### 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
#### 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