torus

network.torus(sizex, sizey, a, node=dynNode, edge=weightedEdge)
Adds a 2-dimensional, cyclic lattice to the network.

Parameters

sizex: integer
Size of the lattice in x-direction.
sizey: integer
Size of the network in y-direction.
a : double
Every node is connected to all neighbours in a distance smaller than a.
node : node template
Every added node is a copy of this template.
edge : edge template
Every added edge is a copy of this template.

Example (python-conedy)

import conedy as co

N = co.network()

N.torus (40,40,1.5, co.node(), co.weightedEdge(1.0)) #creates a torus of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors

print "should be 8:" + str(N.meanDegree())
print "should be "+ str(12.0/28) +":" + str(N.meanClustering())

Example (conedy)

network N;

N.torus (40,40,1.5, node(), weightedEdge(1.0)); #creates a torus of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors

print "should be 8:" + N.meanDegree()+ newline;
print "should be "+ (12.0/28.0) +":" + N.meanClustering()+ newline;

Table Of Contents

Previous topic

streamInLattice

Next topic

torusNearestNeighbors