コード例 #1
0
import conedy as co

n = co.network()

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

n.cycle(10000, 2, co.node(), co.staticWeightedEdge(1.0))

n.replaceEdges(0.5, co.weightedEdge())
print "Should be 4:"
print n.meanDegree()

n.removeEdges(co.weightedEdge())

print "Should be close to 2:"
print n.meanDegree()
コード例 #2
0
co.set("nodeVerbosity", 1)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 1, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print "\n\n"

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 2, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print "\n\n"

j = N.addNode(co.roessler())
N.addEdge(i, j, co.weightedEdge(1.0))

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 1)
print "nodeVerbosity = 2, edgeVerbosity = 1\n"
print "------------------------------------\n"
N.printNodeStatistics()
print "\n\n"

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 2)
print "nodeVerbosity = 2, edgeVerbosity = 2\n"
print "------------------------------------\n"
N.printNodeStatistics()
print "\n\n"
コード例 #3
0
import conedy as co

n = co.network()

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


n.cycle( 10000, 2,  co.node(), co.staticWeightedEdge(1.0))


n.replaceEdges (0.5, co.weightedEdge())
print "Should be 4:"
print n.meanDegree()

n.removeEdges (co.weightedEdge())


print "Should be close to 2:"
print n.meanDegree()

コード例 #4
0
co.set("pcoIntegrateFire_noiseFrequency", 0.0)
co.set("pcoIntegrateFire_timeDelay", 0.01)
co.set("pcoIntegrateFire_t_ref", 0.05)
co.set("pcoIntegrateFire_alpha", 0.9)


N = co.network()




rewiring = 0.5
coupling = 0.012

#n.useLatticePositioning(100,100);

N.torusNearestNeighbors(40,40,36.0, co.pcoIntegrateFire(), co.weightedEdge())

N.rewire(rewiring)

N.randomizeStates(co.pcoIntegrateFire(), co.uniform(0.0,1.0));
N.randomizeWeights(co.uniform(coupling,coupling));

N.saveAdjacencyList("output/nonconverging.py.graph");

N.observeTime("output/nonconverging.py.phaseCoherence");
N.observePhaseCoherence("output/nonconverging.py.phaseCoherence");
N.evolve(0.0,100.0);

コード例 #5
0
ファイル: rewireWeights.py プロジェクト: ThorstenRings/Conedy
import conedy as co


N = co.network();


N.cycle (100,10, co.node(), co.weightedEdge());
print "should be 20:"+ str(N.meanDegree())
N.saveAdjacencyList("output/rewireWeights.co.before");


N.rewireWeights(0.5, co.uniform (2.0,2.0));

N.saveAdjacencyList("output/rewireWeights.co.after");
print "should be close to 1.5:"+ str(N.meanWeight())

コード例 #6
0
import conedy as co

N = co.network()

source = N.addNode(co.node())
target = N.addNode(co.node())
N.addEdge(source, target, co.weightedEdge(1.0))

print "Should be True: " + str(N.isLinked(source, target))
print "Should be Talse: " + str(N.isLinked(target, source))
コード例 #7
0
ファイル: cycle.py プロジェクト: AlexanderRothkegel/Conedy
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())
コード例 #8
0
import conedy as co


N = co.undirectedNetwork()

for i in range (0,100):
	N.addNode(co.node())

N.addRandomEdges (10.0, co.weightedEdge(0.5))

print "should be 10:" + str(N.meanDegree())
print "should be false:" + str(N.isDirected())

N.setDirected();

N.addRandomEdges (20.0, co.weightedEdge (0.5))

print "should be 20:" + str(N.meanDegree())
print "should be true:" + str(N.isDirected())


コード例 #9
0
import conedy as co
N = co.network()
co.set ("roessler_a", 0.22)
co.set ("roessler_b", 0.1)
co.set ("roessler_c", 8.5)
r1 = N.addNode(co.roessler())
r2 = N.addNode(co.roessler())
r3 = N.addNode(co.roessler())
N.setParam(r1, "roessler_omega", 1.02)
N.setParam(r2, "roessler_omega", 1.0)
N.setParam(r3, "roessler_omega", 0.98)
N.randomizeStates (co.roessler(), co.uniform (-10.0, 10.0),co.uniform (-5.0, 5.0), co.uniform (-0.5, 1.5))
N.addEdge(r1, r2, co.weightedEdge(0.075))
N.addEdge(r2, r1, co.weightedEdge(0.075))
N.addEdge(r1, r3, co.weightedEdge(0.075))
N.addEdge(r3, r1, co.weightedEdge(0.075))
N.evolve(0.0, 100.0)
N.observeTime("roessler.dat")
N.observe(r1, "roessler.dat", co.component(1))
N.observe(r2, "roessler.dat", co.component(1))
N.observe(r3, "roessler.dat", co.component(1))
co.set("samplingTime", 0.01)
N.evolve(100.0, 200.0)

コード例 #10
0
import conedy as co

N = co.network()

N.completeNetwork(
    10
)  # creates a network of 10 nodes, where every pair is connected by an unweighted edge
print "Should be 9: " + str(N.meanDegree())

N.clear()
N.cycle(50, 3, co.node(), co.weightedEdge())
N.rewire(0.9)
print "Should be 6: " + str(N.meanDegree())
コード例 #11
0
import conedy as co

N = co.network()

N.randomNetwork(10, 0.1, co.kuramoto(), co.weightedEdge())

N.observeAll("output/observeAll.allStates")

for i in range(0, 10):
    N.observe(i, "output/observeAll.allStates2")

N.evolve(0.0, 10.0)
コード例 #12
0
co.set("roessler_b", 0.2)
co.set("roessler_c", 10.0)

co.set("samplingTime", 0.01)

N.addNode(co.roessler())

#co.set("roessler_omega", 1.0)

N.setParam(0, "roessler_omega", 1.0)

N.addNode(co.roessler())

#N.addWeightedEdge(0,1,0.5)
#N.addWeightedEdge(1,0,0.5)
N.addEdge(0, 1, co.weightedEdge(0.5))
N.addEdge(1, 0, co.weightedEdge(0.5))

N.setState(0, 0.0, 0.0, 0.0)
N.setState(1, 1.0, 1.0, 0.0)

N.printNodeStatistics()

N.observeTime("output/roesslerRoesslerCoupled.py.series")

N.observe(0, "output/roesslerRoesslerCoupled.py.series", co.component(0))
N.observe(0, "output/roesslerRoesslerCoupled.py.series", co.component(1))
N.observe(0, "output/roesslerRoesslerCoupled.py.series", co.component(2))

N.observe(1, "output/roesslerRoesslerCoupled.py.series", co.component(0))
N.observe(1, "output/roesslerRoesslerCoupled.py.series", co.component(1))
コード例 #13
0
import conedy as co

N = co.network()

N.cycle(100, 4)
print "Should be close to %f: %f" % (9. / 14, N.meanClustering())

N.clear()
N.torus(40, 40, 1.5, co.node(), co.weightedEdge(1.0))
print "Should be close to %f: %f" % (6. / 14, N.meanClustering())
コード例 #14
0
import conedy as co

N = co.network()

N.torusNearestNeighbors(
    40, 40, 36.0, co.node(), co.weightedEdge()
)  #creates a torus of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors and to 2 neighbors with distance 2 randomly chosen

print "should be 36.0:" + str(N.meanDegree())
コード例 #15
0
import conedy as co

N = co.network()

N.line(
    1000, 1, co.node(), co.weightedEdge(1.0)
)  # Creates a closed chain of 100 nodes where each is connected to its 10 nearest neighbors to each side.

print "should be 1000:" + str(N.numberVertices())
print "should be 1.0:" + str(N.meanWeight())

print "should be 0.0:" + str(N.meanClustering())
print "should be 333:" + str(N.meanPathLength())

print "should be close to 2:" + str(N.meanDegree())
コード例 #16
0
import conedy as co


N = co.network()

N.completeNetwork(10)  # creates a network of 10 nodes, where every pair is connected by an unweighted edge
print "Should be 9: " + str (N.meanDegree())


N.clear()
N.cycle(50, 3, co.node(), co.weightedEdge())
N.rewire(0.9)
print "Should be 6: " + str (N.meanDegree())
コード例 #17
0
import conedy as co

N = co.undirectedNetwork()

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

N.addEdge(0, 1, co.weightedEdge(1))

print "Should be false:" + str(N.isDirected())

N.removeEdges(co.weightedEdge(1))

N.setDirected()

N.addEdge(0, 1, co.weightedEdge(1))

print "Should be true:" + str(N.isDirected())
コード例 #18
0
import conedy as co

N = co.network()


N.randomNetwork (10, 0.2, co.node(), co.weightedEdge());

N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat")
N.clear()
N.createFromAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat")

N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat2")

コード例 #19
0
import conedy as co

N = co.network()

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

print "should be slightly smaller than 8:" + str(N.meanDegree())
print "should be close to "+ str(12.0/28) +":" + str(N.meanClustering())








コード例 #20
0
import conedy as co

N = co.network()







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

N.addEdge (firstNode,secondNode,co.weightedEdge (0.1) )


N.printNodeStatistics()

コード例 #21
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()
コード例 #22
0
ファイル: line.py プロジェクト: ThorstenRings/Conedy
import conedy as co



N = co.network()


N.line(1000,1, co.node(), co.weightedEdge(1.0))  # Creates a closed chain of 100 nodes where each is connected to its 10 nearest neighbors to each side.


print "should be 1000:" + str ( N.size() )
print "should be 1.0:" + str ( N.meanWeight() )

print "should be 0.0:" + str ( N.meanClustering() ) 
print "should be 333:" + str ( N.meanPathLength() )

print "should be close to 2:" + str ( N.meanDegree() )
コード例 #23
0
ファイル: torus.py プロジェクト: AlexanderRothkegel/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())

コード例 #24
0
import conedy as co

N = co.network()

N.completeNetwork(10, co.node(), co.weightedEdge())

N.saveAdjacencyList("output/saveAdjacencyList.py.mat")
N.clear()
N.createFromAdjacencyList("output/saveAdjacencyList.py.mat")

N.saveAdjacencyList("output/saveAdjacencyList.py.mat2")
コード例 #25
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())
コード例 #26
0
import conedy as co

N = co.network()

N.torusNearestNeighbors (40,40,36.0, co.node(), co.weightedEdge()) #creates a torus of nodes, where each is connected to its 8 (4 direct, 4 diagonal) nearest neighbors and to 2 neighbors with distance 2 randomly chosen

print "should be 36.0:" + str(N.meanDegree()) 

コード例 #27
0
import conedy as co

N = co.network()

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

N.addEdge(firstNode, secondNode, co.weightedEdge(0.1))

N.printNodeStatistics()
コード例 #28
0
import conedy as co

N = co.network()

N.addNode(co.kuramoto())
N.addNode(co.kuramoto())

N.addEdge (0,1, co.weightedEdge(2.0))
print "Should be true: " + str (N.isDirected())
N.addEdge (1,0, co.weightedEdge(0.1))
print "Should be true: " + str (N.isDirected())
N.randomizeWeights(co.uniform (3.0, 3.0))
print "Should be false: " + str (N.isDirected())


コード例 #29
0
N = co.network()

co.set("roessler_omega", 20.0)
co.set("roessler_a", 0.165)
co.set("roessler_b", 0.2)
co.set("roessler_c", 10.0)
co.set("lorenz_S", 10.0)
co.set("lorenz_r", 28.0)
co.set("lorenz_b", 8.0 / 3.0)

co.set("samplingTime", 0.01)

i = N.addNode(co.roessler())
j = N.addNode(co.lorenz())

N.addEdge(i, j, co.weightedEdge(2.5))

N.setState(i, 0.0, 0.0, 0.0)
N.setState(j, 1.0, 1.0, 1.0)

N.observeTime("output/roesslerLorenzCoupled.py.series")
N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(0))
N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(1))
N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(2))
N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(0))
N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(1))
N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(2))

N.evolve(0.0, 1500.0)
コード例 #30
0
import conedy as co

N = co.undirectedNetwork()

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


N.addEdge(0,1,co.weightedEdge(1))


print "Should be false:" + str(N.isDirected())

N.removeEdges(co.weightedEdge(1))

N.setDirected()

N.addEdge(0,1,co.weightedEdge(1))

print "Should be true:" + str(N.isDirected())
コード例 #31
0
ファイル: removeEdge.py プロジェクト: ThorstenRings/Conedy
import conedy as co

N=co.network()

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

N.addEdge(0, 1, co.weightedEdge(0.1))
N.isLinked(0, 1)

N.removeEdge(0, 1, co.weightedEdge(0.1))   
N.isLinked(0, 1)

コード例 #32
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))
コード例 #33
0
import conedy as co

N = co.directedNetwork()

N.randomNetwork(100, 0.2, co.node(),  co.weightedEdge(1.0))

print "should be close to 20:" + str( N.meanDegree() ) 
print "should be close to 0.2:" + str( N.meanClustering() ) 
print "should be directed:" + str (N.isDirected())

UN = co.undirectedNetwork()

UN.randomNetwork(100, 0.2, co.node(),  co.weightedEdge(1.0))

print "should be close to 20:" + str( UN.meanDegree() ) 
print "should be close to 0.2:" + str( UN.meanClustering() ) 
print "should be undirected:" + str (UN.isDirected())

コード例 #34
0
import conedy as co

N = co.network()

i = N.addNode(co.kuramoto())
j = N.addNode(co.kuramoto())

N.addEdge(j, i, co.weightedEdge(1.0))
print "should return an error: "
if (N.isConnected()):
    print ""
print "\n"

N.clear()
N.cycle(500, 1)
print "should be connected: "
if (N.isConnected()):
    print "connected "
print "\n"

N.addNode(co.kuramoto())
print "should be disconnected: "
if not (N.isConnected()):
    print "disconnected "
コード例 #35
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())

コード例 #36
0
ファイル: addEdge.py プロジェクト: ThorstenRings/Conedy
import conedy as co

N = co.network()

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

#N.addEdge(0,1,co.weightedEdge(0.3))

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


N.saveAdjacencyList("output/addEdge.py.adjList")
コード例 #37
0
import conedy as co

N = co.network()

N.randomNetwork (10,0.1,co.kuramoto(), co.weightedEdge())

N.observeAll ("output/observeAll.allStates")


for i in range (0,10):
	N.observe (i, "output/observeAll.allStates2")


N.evolve(0.0,10.0)


コード例 #38
0
ファイル: NetworkFrame.py プロジェクト: oric90/Network
        """ DOCSTRING: """
        self.defaultDict_NetworkType.update(self.__networkParams)

        self.cycle(self.defaultDict_NetworkType['nodeCount'],
                   self.defaultDict_NetworkType['nearestNeighbours'],
                   self.defaultDict_NetworkType['nodeType'],  
                   self.defaultDict_NetworkType['edgeType']
                  )
        self.rewire(self.defaultDict_NetworkType['rewiringProbability'],
                    self.defaultDict_NetworkType['nodeType']
                   )
        self.randomizeStates(self.defaultDict_NetworkType['nodeType'],
                             self.defaultDict_NetworkType['distributionType']   
                            )
        self.__networkInitialized = True

    def __initScaleFree(self):
        raise IOError ('scaleFree creation not yet defined')
    
    def __initRandomGraph(self):
        raise IOError ('randomGraph creation not yet defined')        

newNet = Network()
newNet.updateNetworkParams({'networkType': 'smallWorld', 'edgeType': co.weightedEdge(0.01), 'nodeType': co.pcoIntegrateFire()})
newNet.initNetwork()
#newNet.initNodes()
#for i in range(0,10000):
#    print newNet.getParam(i,'pcoIntegrateFire_t_ref')


コード例 #39
0
import conedy as co

N = co.network()

N.cycle(99, 1, co.node(), co.weightedEdge(0.25))
print "Should be 100: %f" % N.meanPathLength()
コード例 #40
0
print "nodeVerbosity = 1, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print"\n\n"

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 2, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print"\n\n"



j = N.addNode(co.roessler())
N.addEdge(i, j, co.weightedEdge(1.0))

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 1)
print "nodeVerbosity = 2, edgeVerbosity = 1\n"
print "------------------------------------\n"
N.printNodeStatistics()
print"\n\n"

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 2)
print "nodeVerbosity = 2, edgeVerbosity = 2\n"
print "------------------------------------\n"
N.printNodeStatistics()
print"\n\n"
コード例 #41
0
import conedy as co

N = co.undirectedNetwork()

N.cycle(100, 4, co.node(), co.weightedEdge(0.1))
N.rewire(0.3)
print "Initial mean degree:" + str(N.meanDegree())

N.removeRandomEdges(0.5, co.weightedEdge(0.1))
print "Should have changed:" + str(N.meanDegree())
コード例 #42
0
import conedy as co

N=co.undirectedNetwork()

N.cycle(100, 4, co.node(), co.weightedEdge(0.1))
N.rewire(0.3)
print "Initial mean degree:" + str(N.meanDegree())

N.removeRandomEdges(0.5, co.weightedEdge(0.1))
print "Should have changed:" + str(N.meanDegree())






コード例 #43
0
import conedy as co

N = co.network()

i = N.cycle(20, 1, co.node(), co.weightedEdge())

N.addEdge(i + 1, i + 7, co.weightedEdge(1.0))
N.addEdge(i + 7, i + 1, co.weightedEdge(2.0))
N.addEdge(i + 1, i +11, co.weightedEdge(3.0))
N.addEdge(i +11, i + 1, co.weightedEdge(4.0))

N.betweennessCentrality("output/betweennessCentrality.py.out")
コード例 #44
0
co.set("samplingTime", 0.01)


N.addNode(co.roessler())

#co.set("roessler_omega", 1.0)

N.setParam (0, "roessler_omega", 1.0);

N.addNode(co.roessler())


#N.addWeightedEdge(0,1,0.5)
#N.addWeightedEdge(1,0,0.5)
N.addEdge(0,1,co.weightedEdge(0.5))
N.addEdge(1,0,co.weightedEdge(0.5))



N.setState(0, 0.0,0.0,0.0)
N.setState(1, 1.0,1.0,0.0)

N.printNodeStatistics();


N.observeTime("output/roesslerRoesslerCoupled.py.series")

N.observe(0,"output/roesslerRoesslerCoupled.py.series", co.component(0))
N.observe(0,"output/roesslerRoesslerCoupled.py.series", co.component(1))
N.observe(0,"output/roesslerRoesslerCoupled.py.series", co.component(2))
コード例 #45
0
import conedy as co

N = co.network()

N.cycle(100, 1, co.node(), co.weightedEdge())

N.randomizeWeights(co.uniform(0.0, 1.50))

print "should be close to 0.75:" + str(N.meanWeight())
コード例 #46
0
import conedy as co
from os import system

n = co.network()

networkSize = 10

n.randomNetwork(networkSize, 0.4, co.node(), co.weightedEdge())
n.randomizeWeights(co.uniform(1.1, 1.1))

n.saveAdjacencyList("output/normalizeInputs.co.before")
n.normalizeInWeightSum(3.0)

print "Should be " + 3.0 / n.meanDegree() + " :" + n.meanWeight()

n.saveAdjacencyList("output/normalizeInputs.co.after")

system(
    "sort -n output/normalizeInputs.co.after -k2 > output/normalizeInputs.co.after.sort"
)
コード例 #47
0
ファイル: tutorial.py プロジェクト: ThorstenRings/Conedy
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import conedy as co


N = co.network()

nodeblueprint = co.gaussianRoessler()
co.set("gaussianRoessler_a", 0.165)
co.set("gaussianRoessler_b", 0.2)
co.set("gaussianRoessler_c", 10.0)
co.set("gaussianRoessler_sigmaNoise", 0.1)


N.cycle(100, 4, nodeblueprint, co.weightedEdge(0.1))
N.rewire(0.1)

print "clustering coefficient:" + str(N.meanClustering())
print "mean path length:" + str(N.meanPathLength())

if N.isConnected():
    N.betweennessCentrality("N.betweenness")
    N.closenessCentrality("N.closeness")

N.randomizeParameter("gaussianRoessler_omega", co.uniform(0.8, 1.2))
N.randomizeStates(nodeblueprint, co.uniform(-0.1, 0.1), co.uniform(-0.1, 0.1), co.uniform(-0.1, 0.1))

N.evolve(0.0, 100.0)

N.observeTime("output_Roessler")
コード例 #48
0
ファイル: addEdge.py プロジェクト: Wrzlprmft/Conedy
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))
コード例 #49
0
import conedy as co

N = co.network()

N.lattice(40, 40, 1.5, co.node(), co.weightedEdge())
print "should be 1600: " + str(N.numberVertices())

N.clear()
N.cycle(50, 3, co.node(), co.weightedEdge())
print "should be 50: " + str(N.numberVertices())
コード例 #50
0
ファイル: size.py プロジェクト: ThorstenRings/Conedy
import conedy as co

N = co.network()

N.lattice(40, 40, 1.5, co.node(),co.weightedEdge())
print "should be 1600: " + str(N.size())

N.clear()
N.cycle(50, 3, co.node(), co.weightedEdge() )
print "should be 50: " + str(N.size())

コード例 #51
0
import conedy as co

N = co.network()


N.completeNetwork (10, co.node(), co.weightedEdge());

N.saveAdjacencyMatrix("output/createFromAdjacencyMatrix.py.mat")
N.clear()
N.createFromAdjacencyMatrix("output/createFromAdjacencyMatrix.py.mat")

N.saveAdjacencyMatrix("output/createFromAdjacencyMatrix.py.mat2")




コード例 #52
0
import conedy as co

N = co.network()

N.randomNetwork(10, 0.2, co.node(), co.weightedEdge())

N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat")
N.clear()
N.createFromAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat")

N.saveAdjacencyMatrix("output/saveAdjacencyMatrix.py.mat2")
コード例 #53
0
import conedy as co

N = co.network()

i = N.cycle(20, 1, co.node(), co.weightedEdge())

N.addEdge(i + 1, i + 7, co.weightedEdge(1.0))
N.addEdge(i + 7, i + 1, co.weightedEdge(2.0))
N.addEdge(i + 1, i + 11, co.weightedEdge(3.0))
N.addEdge(i + 11, i + 1, co.weightedEdge(4.0))

N.closenessCentrality("output/closenessCentrality.py.out")
コード例 #54
0
import conedy as co

N = co.network()

#N.completeNetwork (10, co.node(), co.weightedEdge());
N.completeNetwork(10)

N.saveAdjacencyList("output/createFromAdjacencyList.py.mat")
N.clear()
N.createFromAdjacencyList("output/createFromAdjacencyList.py.mat", co.node(),
                          co.weightedEdge())

N.saveAdjacencyList("output/createFromAdjacencyList.py.mat2")