Package datk :: Package core :: Module distalgs :: Class Compose
[hide private]
[frames] | no frames]

Class Compose

source code

        Algorithm --+    
                    |    
Synchronous_Algorithm --+
                        |
                       Compose

A Synchonous_Algorithm that is the composition of two synchronous algorithms running in parallel.

Instance Methods [hide private]
 
__init__(self, A, B, name=None, params=None) source code
 
msgs_i(self, p)
Determines what messages a Process, p, will send.
source code
 
trans_i(self, p, msgs)
Determines what state transition a Process, p, will perform, having received messages, msgs
source code
 
halt_i(self, p)
Returns True iff Process p has halted execution of the algorithm
source code
 
cleanup_i(self, p)
Determines what final state transition a Process, p, will perform, after the algorithm terminates.
source code
 
run(self, network, params={})
Executes the algorithm on the network
source code
 
__repr__(self) source code

Inherited from Synchronous_Algorithm: execute, msgs, print_algorithm_terminated, round, trans

Inherited from Algorithm: __call__, cleanup, count_msg, delete, get, halt, has, increment, output, set

Class Variables [hide private]

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

Method Details [hide private]

__init__(self, A, B, name=None, params=None)
(Constructor)

source code 
Parameters:
  • A - an instance of Synchronous_Algorithm
  • B - an instance of Synchronous_Algorithm
  • name - [Optional] name of the Algorithm. Defaults to Compose(name of A, name of B)
  • params - [Optional] Runtime parameters
Overrides: Algorithm.__init__

msgs_i(self, p)

source code 

Determines what messages a Process, p, will send.

Overrides: Algorithm.msgs_i
(inherited documentation)

trans_i(self, p, msgs)

source code 

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

Overrides: Algorithm.trans_i
(inherited documentation)

halt_i(self, p)

source code 

Returns True iff Process p has halted execution of the algorithm

Overrides: Algorithm.halt_i
(inherited documentation)

cleanup_i(self, p)

source code 

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

Overrides: Algorithm.cleanup_i
(inherited documentation)

run(self, network, params={})

source code 

Executes the algorithm on the network

Parameters:
  • network - the parameter to run in
  • params - runtime parameters
Overrides: Algorithm.run
(inherited documentation)