koi_net.components.graph
Classes
|
Graph functions for this node's view of its network. |
- class koi_net.components.graph.NetworkGraph(log, cache, identity)[source]
Bases:
objectGraph functions for this node’s view of its network.
- Parameters:
log (Logger)
cache (Cache)
identity (NodeIdentity)
- cache: Cache
- dg: DiGraph
- get_edge(source, target)[source]
Returns edge RID given the RIDs of a source and target node.
- Return type:
KoiNetEdge|None- Parameters:
source (KoiNetNode)
target (KoiNetNode)
- get_edges(direction=None)[source]
Returns edges this node belongs to.
All edges returned by default, specify direction to restrict to incoming or outgoing edges only.
- Return type:
list[KoiNetEdge]- Parameters:
direction (Literal['in', 'out'] | None)
- get_neighbors(direction=None, status=None, allowed_type=None)[source]
Returns neighboring nodes this node shares an edge with.
All neighboring nodes returned by default, specify direction to restrict to neighbors connected by incoming or outgoing edges only.
- Return type:
list[KoiNetNode]- Parameters:
direction (Literal['in', 'out'] | None)
status (EdgeStatus | None)
allowed_type (RIDType | None)
- identity: NodeIdentity
- log: Logger