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

Class AsynchConvergeHeight

source code

         distalgs.Algorithm --+        
                              |        
distalgs.Asynchronous_Algorithm --+    
                                  |    
                 AsynchConvergecast --+
                                      |
                                     AsynchConvergeHeight

A Convergecast Algorithm that results in the root node, p, knowing p.state['height'], the height of the tree rooted at p.

Requires:

Effects:

Instance Methods [hide private]
 
cleanup_i(self, p)
Determines what final state transition a Process, p, will perform, after the algorithm terminates.
source code
 
initial_msg_to_parent(self, p)
Defines the initial message sent from a leaf process to its parent at the beginning of the Convergecast
source code
 
output_root(self, p)
Determines the output action, if any, that the root should perform at the end of the Convergecast.
source code
 
trans_msg_to_parent(self, p, msgs)
Defines the message a non-leaf, non-root Process should send to its parent when it has received all its children's messages
source code
 
trans_root(self, p, msgs)
Determines the state transition the root node should undergo when it receives messages
source code

Inherited from AsynchConvergecast: is_root, msgs_i, trans_i

Inherited from distalgs.Asynchronous_Algorithm: run, run_process

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

Class Variables [hide private]

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

Method Details [hide private]

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)

initial_msg_to_parent(self, p)

source code 

Defines the initial message sent from a leaf process to its parent at the beginning of the Convergecast

Parameters:
  • p - A Process at a leaf of the BFS tree
Returns:
the Message p should send to its state['parent']
Overrides: AsynchConvergecast.initial_msg_to_parent
(inherited documentation)

output_root(self, p)

source code 

Determines the output action, if any, that the root should perform at the end of the Convergecast.

Overrides: AsynchConvergecast.output_root
(inherited documentation)

trans_msg_to_parent(self, p, msgs)

source code 

Defines the message a non-leaf, non-root Process should send to its parent when it has received all its children's messages

Parameters:
  • p - a Process that has both p.state['parent'] != null, and p.state['children'] not empty
  • msgs - A list of messages from every child of p (in p.state['children'])
Returns:
the Message p should send to its state['parent']
Overrides: AsynchConvergecast.trans_msg_to_parent
(inherited documentation)

trans_root(self, p, msgs)

source code 

Determines the state transition the root node should undergo when it receives messages

Parameters:
  • p - the root Process
  • msgs - the messages received by the root Process, from its BFS children
Overrides: AsynchConvergecast.trans_root
(inherited documentation)