Package datk :: Package core :: Module networks :: Class Random_Line_Network
[hide private]
[frames] | no frames]

Class Random_Line_Network

source code

distalgs.Network --+
                   |
                  Random_Line_Network

A Network of n processes arranged randomly at the vertices of a connected undirected line graph of size n. Additional pairs of vertices are connected at random with a probability that is inversely proportional to the difference in their positions on the line.

For example, the Process at index 3 is guaranteed to be connected to the Process at index 4, and is more likely to be connected to the Process at index 5 than to the Process at index 8.

Instance Methods [hide private]
 
__init__(self, n, sparsity=1)
sparsity = 0 --> a Complete_Graph(n) sparsity = infinity --> a Bidirectional_Line(n)
source code

Inherited from distalgs.Network: __getitem__, __iter__, __len__, __repr__, add, clone, draw, index, run, state

Method Details [hide private]

__init__(self, n, sparsity=1)
(Constructor)

source code 

sparsity = 0 --> a Complete_Graph(n) sparsity = infinity --> a Bidirectional_Line(n)

Overrides: distalgs.Network.__init__