Class SynchBFSAck
source code
distalgs.Algorithm --+
|
distalgs.Synchronous_Algorithm --+
|
SynchBFSAck
Constructs a BFS tree with children pointers and the 'leader' Process
at its root
Algorithm (Informal): At any point during execution, there is some set
of processes that is "marked," initially just i0. Process i0
sends out a search message at round 1, to all of its outgoing neighbors.
At any round, if an unmarked process receives a search message, it marks
itself and chooses one of the processes from which the search arrived as
its parent. At the first round after a process gets marked, it sends a
search message to all of its outgoing neighbors, and an acknowledgement
to its parent, so that nodes will also know their children.
Requires:
Effects:
-
Every process knows:
-
state['parent']. Leader has state['parent'] = None
-
state['childen']. Leaves have state['children'] = []
|
|
|
|
|
trans_i(self,
p,
msgs)
Determines what state transition a Process, p, will perform, having
received messages, msgs |
source code
|
|
Inherited from distalgs.Synchronous_Algorithm :
execute ,
msgs ,
print_algorithm_terminated ,
round ,
run ,
trans
Inherited from distalgs.Algorithm :
__call__ ,
__init__ ,
cleanup ,
cleanup_i ,
count_msg ,
delete ,
get ,
halt ,
halt_i ,
has ,
increment ,
output ,
set
|
Determines what state transition a Process, p, will perform, having
received messages, msgs
- Overrides:
distalgs.Algorithm.trans_i
- (inherited documentation)
|