101 lines
1.4 KiB
Markdown
101 lines
1.4 KiB
Markdown
# Network map representation
|
||
|
||
### *class* Siph.map.Network(file=None)
|
||
|
||
Layered graph network
|
||
|
||
[🔗 Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/src/Bubble/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
|
||
|
||
#### 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
|
||
|
||
#### id
|
||
|
||
PierMesh node ID
|
||
|
||
* **Type:**
|
||
int
|
||
|
||
#### addoe(nodea: int, nodeb: int)
|
||
|
||
Add edge between nodes on outer map
|
||
|
||
#### addon(id: int)
|
||
|
||
Add node on outer map
|
||
|
||
#### id
|
||
|
||
PierMesh node ID
|
||
|
||
* **Type:**
|
||
int
|
||
|
||
#### 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 = '')
|
||
|
||
Render outer and inner network mao to disk at the given path prefix
|