pydistsim.demo_algorithms.santoro2007.mega_merger.algorithm.MMNode

class MMNode(node: Node, manager: WrapperManager, **configs)[source]

Bases: DMANodeAccess

MMNode 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_neighbors

Get the in-neighbors of the node.

neighbors

Get the out-neighbors of the node.

out_neighbors

Get the out-neighbors of the node.

unbox

Attributes

accessible_get

Attributes that can be 'read' from the node base object.

accessible_set

Attributes that can be 'read' or 'written' to the node base object.

clock

id

Get the id of the node.

memory

status

city

weight

internal_links

children

tree_key

blocked_messages

external_received

weight_received

min_weight

asking_min_weight

last_min_weight_sent

link_trying_merge

link_asking_outside

link_with_min_weight