pydistsim.algorithm.node_wrapper.WrapperManager
- class WrapperManager(network: NetworkType, nodeAccessType: type[~pydistsim.algorithm.node_wrapper.NodeAccess] = <class 'pydistsim.algorithm.node_wrapper.NodeAccess'>, neighborLabelType: type[~pydistsim.algorithm.node_wrapper.NeighborLabel] = <class 'pydistsim.algorithm.node_wrapper.NeighborLabel'>)[source]
Bases:
objectNode Access class
A node’s own view is a proxy for the node that represents the knowledge of the node.
u_own_view and v_own_view are the same object passed as parameters at each algorithm’s action:
@Status.IDLE def receiving(self, node: NodeAccess, message: Message): ↑
Neighbor Label class
A label for a neighbor is a proxy for the neighbor that represents the knowledge of the neighbor respect to the node.
Alternatively, u_label_for_v and v_label_for_u are the objects that are returned when a node asks for its neighbors in some way:
@Status.IDLE def receiving(self, node: NodeAccess, message: Message): source = message.source # The node that sent the message ↑ for neighbor in node.neighbors(): ↑
Methods
__init__calculate_in_neighbors_dictcalculate_out_neighbors_dictReturns the edges of the network as a tuple of proxies for the nodes and the labels of the neighbors.
get_node_accessReturns the proxies for the nodes in the network.
Returns the proxies for the nodes and the labels of it's neighbors.
Attributes
The class that will be used to wrap the neighbors' labels.
The class that will be used to wrap the nodes' own view.
- NEIGHBOR_LABEL_TYPE
The class that will be used to wrap the neighbors’ labels.
alias of
type[NeighborLabel]
- NODE_ACCESS_TYPE: type[NodeAccess]
The class that will be used to wrap the nodes’ own view.