setUndirected

network.setUndirected()
Marks the network as undirected. For network generators which have two variants for directed or undirected networks (e.g. network.randomNetwork), the latter is now chosen.

Example (python-conedy)

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

Example (conedy)

undirectedNetwork n;

n.addNode(node());
n.addNode(node());


n.addEdge(0,1,weightedEdge(1));

print "Should be false:" + n.isDirected() + newline;

n.removeEdges(weightedEdge(1));

n.setDirected();

n.addEdge(0,1,weightedEdge(1));

print "Should be true:" + n.isDirected() + newline;

Table Of Contents

Previous topic

setState

Next topic

streamInLattice