pydistsim.demo_algorithms.santoro2007.mega_merger.algorithm.MMNode
- class MMNode(node: Node, manager: WrapperManager, **configs)[source]
Bases:
DMANodeAccessMMNode class represents a node in the Mega Merger algorithm.
- Attributes:
id (int): Unique identifier for the node. city (City): The city associated with the node. weight (dict[NeighborLabel, int]): Weights of the links to neighboring nodes.
internal_links (set[NeighborLabel]): Set of internal links to neighboring nodes. children (set[NeighborLabel]): Set of child nodes. tree_key (dict[str, NeighborLabel]): Dictionary mapping tree keys to neighbor labels. blocked_messages (dict[tuple[NeighborLabel, MMHeaders], Message]): Messages that are blocked and waiting to be
processed.
external_received (bool): Flag indicating if an external message has been received since the last reset. weight_received (set[NeighborLabel]): Set of neighbors from which weight has been received since the last round
of asking for the minimum weight.
min_weight (int): Minimum weight among the links received in the last round. asking_min_weight (bool): Flag indicating if the node is asking for the minimum weight. last_min_weight_sent (int): Last minimum weight sent by the node. link_trying_merge (NeighborLabel): Link that is trying to merge. link_asking_outside (NeighborLabel): Link that is asking for an outside connection. link_with_min_weight (NeighborLabel): Link directing to the minimum weight (might be this link or another down
the tree).
Methods
__init__in_neighborsGet the in-neighbors of the node.
neighborsGet the out-neighbors of the node.
out_neighborsGet the out-neighbors of the node.
unboxAttributes
accessible_getAttributes that can be 'read' from the node base object.
accessible_setAttributes that can be 'read' or 'written' to the node base object.
clockidGet the id of the node.
memorystatuscityweightinternal_linkschildrentree_keyblocked_messagesexternal_receivedweight_receivedmin_weightasking_min_weightlast_min_weight_sentlink_trying_mergelink_asking_outsidelink_with_min_weight