piermesh/docs/Siph/map.md

95 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a id="network-network-map-representation"></a>
# Network: Network map representation
### *class* Siph.map.Network(file=None)
Layered graph network
[🔗 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
#### 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
* **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
* **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 = '')
Render outer and inner network map to disk at the given path prefix