Пример #1
0
import conedy as co



N= co.network()
co.setRandomSeed(0);

node = co.roessler()
edge = co.weightedEdge(1.0)


N.cycle( 1000, 10, node,edge)


print "mean degree before rewiring:" + str( N.meanDegree())
print "should be close to 0.75:" + str( N.meanClustering())
N.rewire(1.0)
print "mean degree after rewiring:" + str( N.meanDegree())
print "should be close to 0.0:" + str( N.meanClustering())
#print n.meanDegree()
Пример #2
0
import conedy as co

co.setRandomSeed(10) # set the random seed to 10
Пример #3
0
import conedy as co

co.setRandomSeed(0)

N = co.network()

N.cycle(
    1000, 50, co.node(), co.weightedEdge()
)  # Creates a closed chain of 1000 nodes where each is connected to its 50 nearest neighbors to each side.

print "should be close to 0.75:" + str(N.meanClustering())
print "should be close to " + str(1000.0 / 2 / 100) + ":" + str(
    N.meanPathLength())
print "should be 100:" + str(N.meanDegree())
Пример #4
0
import conedy as co


N = co.network()
co.setRandomSeed(0)

node = co.roessler()
edge = co.weightedEdge(1.0)


N.cycle(1000, 10, node, edge)


print "mean degree before rewiring:" + str(N.meanDegree())
print "should be close to 0.75:" + str(N.meanClustering())
N.rewire(1.0)
N.saveAdjacencyList("testPython")
print "mean degree after rewiring:" + str(N.meanDegree())
print "should be close to 0.0:" + str(N.meanClustering())
# print n.meanDegree()