Package datk :: Package core :: Module algs :: Class FloodMax
[hide private]
[frames] | no frames]

Class FloodMax

source code

        distalgs.Algorithm --+    
                             |    
distalgs.Synchronous_Algorithm --+
                                 |
                                FloodMax

UID flooding algorithm for Leader Election in a general network

Every process maintains a record of the maximum UID it has seen so far (initially its own). At each round, each process propagates this maximum on all of its outgoing edges. After diam rounds, if the maximum value seen is the process's own UID, the process elects itself the leader; otherwise, it is a non-leader.

Requires:

Instance Methods [hide private]
 
msgs_i(self, p)
Determines what messages a Process, p, will send.
source code
 
trans_i(self, p, msgs, verbose=False)
Determines what state transition a Process, p, will perform, having received messages, msgs
source code
 
cleanup_i(self, p)
Determines what final state transition a Process, p, will perform, after the algorithm terminates.
source code

Inherited from distalgs.Synchronous_Algorithm: execute, msgs, print_algorithm_terminated, round, run, trans

Inherited from distalgs.Algorithm: __call__, __init__, cleanup, count_msg, delete, get, halt, halt_i, has, increment, output, set

Class Variables [hide private]

Inherited from distalgs.Algorithm: DEFAULT, DEFAULT_PARAMS, QUIET, SILENT, VERBOSE

Method Details [hide private]

msgs_i(self, p)

source code 

Determines what messages a Process, p, will send.

Overrides: distalgs.Algorithm.msgs_i
(inherited documentation)

trans_i(self, p, msgs, verbose=False)

source code 

Determines what state transition a Process, p, will perform, having received messages, msgs

Overrides: distalgs.Algorithm.trans_i
(inherited documentation)

cleanup_i(self, p)

source code 

Determines what final state transition a Process, p, will perform, after the algorithm terminates.

Overrides: distalgs.Algorithm.cleanup_i
(inherited documentation)