Class SynchBFS
source code
distalgs.Algorithm --+
|
distalgs.Synchronous_Algorithm --+
|
SynchBFS
Constructs a BFS tree with the 'leader' Process at its root
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 has arrived as its parent. At
the first round after a process gets marked, it sends a search message to
all of its outgoing neighbors.
Requires:
Effects:
-
every Process has state['parent']. Leader has state['parent'] = None
|
|
|
|
|
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)
|