pydistsim.demo_algorithms.santoro2007.yoyo.YoYo
- class YoYo(*args, **kwargs)[source]
Bases:
NodeAlgorithmMethods
__init__add_observersalarmapply_restrictionsApply all applicable restrictions.
block_inboxBlock the inbox of a node, so that only messages that satisfy the filter can be processed.
change_statuscheck_algorithm_initializationCheck if the algorithm's current state matches the expected initial state.
check_algorithm_terminationCheck if the algorithm's current state matches the expected termination state.
check_restrictionsCheck if the restrictions are satisfied.
clear_observerscloseClose the inbox of the node for a specific neighbor.
defaultdefault_LEADERdefault_PRUNEDdisable_alarmDisable an alarm.
disable_all_node_alarmsDisable all alarms set for the node.
dodo_intermediatedo_sinkdo_sourceMethod used to initialize the algorithm.
invert_edgesis_haltedCheck if the distributed algorithm has come to an end or deadlock, i.e. there are no messages to pass and no alarms set.
is_initializednotify_observersopenOpen the inbox of the node for a specific neighbor.
prune_nodesreceive_idreceive_responsereceivingreceiving_IDLEreceiving_INTERMEDIATEreceiving_SINKreceiving_SOURCEresetReset the algorithm to its initial state.
sendSend content to destination, with header.
send_msgSend a message to nodes listed in message's destination field.
send_responsesset_alarmSet an alarm for the node.
spontaneouslyspontaneously_INITIATORstepunblock_inboxUnblock the inbox of a node, so that all messages can be processed.
update_alarm_timeUpdate the time of an alarm by adding a time difference.
Attributes
ID_KEYINIPRUNE_REQUESTRECEIVED_IDS_KEYRECEIVED_IDS_WHILE_WAITING_RESPONSE_KEYRECEIVED_RESPONSES_KEYREQUESTED_PRUNING_KEYSENT_IDS_KEYTuple of statuses that nodes should have at the beginning of the algorithm.
Tuple of statuses that nodes should have at the end of the algorithm.
Tuple of restrictions that must be satisfied for the algorithm to run.
default_paramsnetworkrequired_paramsnwmNode wrapper manager.
- S_init = (Status.INITIATOR, Status.IDLE)
Tuple of statuses that nodes should have at the beginning of the algorithm.
- S_term = (Status.LEADER, Status.PRUNED)
Tuple of statuses that nodes should have at the end of the algorithm.
- class Status(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
StatusValues- __new__(value)
- _generate_next_value_(start, count, last_values)
Return the lower-cased version of the member name.
- algorithm_restrictions = (<class 'pydistsim.restrictions.communication.BidirectionalLinks'>, <class 'pydistsim.restrictions.reliability.TotalReliability'>, <class 'pydistsim.restrictions.topological.Connectivity'>, <class 'pydistsim.restrictions.knowledge.InitialDistinctValues'>)
Tuple of restrictions that must be satisfied for the algorithm to run.