addEdge

network.addEdge(source, target, edgeTemplate)
Adds an edge to the network connecting node “source” with node “target”.

Parameters

source: int
Number of the node which is the source of the added connection.
target: int
Number of the node which is the target of the added connection.

Note

For nodes which represent a differential equation, the added connection represent a coupling in the expected direction (source influences target).

Example (python-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))

Example (conedy)

network N;


N.addNode(node());
N.addNode();

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

N.printNodeStatistics();


undirectedNetwork uN;

int sourceNode = uN.addNode (node());
int targetNode = uN.addNode (node());

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

print "linkStrength (should be 1.0):" + uN.linkStrength (sourceNode,targetNode) + newline;

Table Of Contents

Previous topic

Creation and manipulation

Next topic

addNode