pydistsim.algorithm.network_algorithm.NetworkAlgorithm

class NetworkAlgorithm(*args, **kwargs)[source]

Bases: BaseAlgorithm

Abstract base class for specific centralized algorithms.

This class is used as base class holding real network algorithm classes in its __subclassess__ for easy instantiation

Method __init__ and run should be implemented in subclass.

Methods

__init__

add_observers

apply_restrictions

Apply all applicable restrictions.

check_restrictions

Check if the restrictions are satisfied.

clear_observers

is_halted

Check if the distributed algorithm has come to an end or deadlock.

is_initialized

notify_observers

reset

Reset the algorithm to its initial state.

run

step

Attributes

algorithm_restrictions

Tuple of restrictions that must be satisfied for the algorithm to run.

default_params

network

required_params

is_halted()[source]

Check if the distributed algorithm has come to an end or deadlock.