pydistsim.tests.test_metrics.CustomAlgorithm
- class CustomAlgorithm(*args, **kwargs)[source]
Bases:
FloodMethods
__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.
check_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.
defaultDo nothing, for all inputs.
disable_alarmDisable an alarm.
disable_all_node_alarmsDisable all alarms set for the node.
initializerMethod used to initialize the algorithm.
is_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.
receivingreceiving_IDLEresetReset the algorithm to its initial state.
sendSend content to destination, with header.
send_msgSend a message to nodes listed in message's destination field.
set_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
INIS_initTuple of statuses that nodes should have at the beginning of the algorithm.
S_termTuple of statuses that nodes should have at the end of the algorithm.
algorithm_restrictionsTuple of restrictions that must be satisfied for the algorithm to run.
default_paramsnetworkrequired_paramsnwmNode wrapper manager.
- default_DONE(*args, **kwargs)
Do nothing, for all inputs.