import conedy as co

net = co.network()




net.addNode (co.node())
net.addEdge (0,0,co.weightedEdge(1.0))
net.removeEdges(co.weightedEdge())
print "Should be 0:" + str(net.meanDegree())
net.clear()


net.cycle (10000, 2, co.node(), co.staticWeightedEdge())


net.rewire (0.5, co.weightedEdge(1.0))
print "Should be 4:" + str(net.meanDegree())

net.removeEdges (co.weightedEdge(1.0))


print "Should be close to 2:" + str(net.meanDegree())

Exemple #2
0
import conedy as co

net = co.network()

net.addNode(co.node())
net.addEdge(0, 0, co.weightedEdge(1.0))
net.removeEdges(co.weightedEdge())
print "Should be 0:" + str(net.meanDegree())
net.clear()

net.cycle(10000, 2, co.node(), co.staticWeightedEdge())

net.rewire(0.5, co.weightedEdge(1.0))
print "Should be 4:" + str(net.meanDegree())

net.removeEdges(co.weightedEdge(1.0))

print "Should be close to 2:" + str(net.meanDegree())
Exemple #3
0
import conedy as co

N = co.network()

N.addNode(co.node())
N.addNode()

N.addEdge(0, 1, co.weightedEdge(0.3))
N.addEdge(1, 0, co.staticWeightedEdge(0.2))

N.printNodeStatistics()

uN = co.undirectedNetwork()
sourceNode = uN.addNode(co.node())
targetNode = uN.addNode()

# addEdge connects nodes in undirected networks also in the opposite direction.
uN.addEdge(sourceNode, targetNode, co.weightedEdge(1.0))


print "linkStrength (should be 1.0):" + str(uN.linkStrength(targetNode, sourceNode))
import conedy as co
N = co.network()
co.set ("gaussianBarkley_sigma",  0.18)

bark = co.gaussianBarkley()
bark.setState (0.0, 0.0)
N.lattice(512, 512, 1.0, bark, co.staticWeightedEdge (3.84))
N.rewire(0.001)
N.evolve(0.0, 20.0)
N.observeAll("waves.dat", co.component(0))
N.snapshot()
Exemple #5
0
import conedy as co

N = co.network()

N.addNode(co.node())
N.addNode()

N.addEdge(0, 1, co.weightedEdge(0.3))
N.addEdge(1, 0, co.staticWeightedEdge(0.2))

N.printNodeStatistics()

uN = co.undirectedNetwork()
sourceNode = uN.addNode(co.node())
targetNode = uN.addNode()

#addEdge connects nodes in undirected networks also in the opposite direction.
uN.addEdge(sourceNode, targetNode, co.weightedEdge(1.0))

print "linkStrength (should be 1.0):" + str(
    uN.linkStrength(targetNode, sourceNode))
import conedy as co

N = co.network()



N.cycle( 100, 10,co.node(), co.staticWeightedEdge())

#N.printNodeStatistics();

print "should be 20:"+ str(N.meanDegree())
N.rewireUndirected(1.0)
print "should be 20:"+ str(N.meanDegree())
N.saveAdjacencyList("output/rewireUndirected.py.graph")

if (N.isDirected()):
	print "Error: The network is directed."




import conedy as co

N = co.network()







firstNode = N.addNode(co.roessler())
secondNode = N.addNode(co.roessler())

N.addEdge (firstNode,secondNode, co.staticWeightedEdge (0.1) )
#N.addEdge (firstNode,secondNode, co.staticWeightedEdge () )
N.addEdge (secondNode,firstNode, co.staticWeightedEdge (0.2) )
# The addition of the second edge changes the coupling strength of the first edge to 0.2!


N.printNodeStatistics()