Miscellaneaous Algorithms¶
Distributed Logic-And¶
- class disropt.algorithms.misc.LogicAnd(agent, graph_diameter, flag=False, enable_log=False, **kwargs)[source]¶
Bases:
disropt.algorithms.algorithm.Algorithm
Logic-And algorithm. It can be used for checking in a distributed way if a certain condition (corresponding to flag=True in the algorithm) is satisfied by all the agents in the network. Details can be found in [FaGa19a]
- Parameters
- check_stop()[source]¶
Check the last row of S
- Returns
True if last row contains only ones. Meaning that all have the flag True
- Return type
- update_column(neighbor, column)[source]¶
Update a column of the matrix corresponding to a neighbor
- Parameters
- Raises
TypeError – second argument must be a numpy.ndarray with shape (graph_diameter, )
ValueError – second argument must be a numpy.ndarray with shape (graph_diameter, )
Asynchronous Distributed Logic-And¶
- class disropt.algorithms.misc.AsynchronousLogicAnd(agent, graph_diameter, flag=False, enable_log=False, **kwargs)[source]¶
Bases:
disropt.algorithms.misc.LogicAnd
Asyncrhonous Logic-And algorithm. It can be used for checking in a distributed way if a certain condition (corresponding to flag=True in the algorithm) is satisfied by all the agents in the network. Details can be found in [FaGa19a]
- Parameters
Distributed Max-Consensus¶
- class disropt.algorithms.misc.MaxConsensus(agent, x0, graph_diameter=None, enable_log=False, **kwargs)[source]¶
Bases:
disropt.algorithms.algorithm.Algorithm
Max-Consensus algorithm. It computes the entry-wise maximum of a numpy array by using only neighboring communication.
- Parameters
References