isDirected

isDirected()
Returns True, iff there are at least two nodes i and j in the network, such that the weight of the edge from i to j differs from the weight of the edge from j to i.

Example (python-conedy)

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

Example (conedy)

network N;

int i = N.addNode(kuramoto());
int j = N.addNode(kuramoto());

N.addEdge(i, j, weightedEdge(2.0));

print "Should be 1: " + N.isDirected() + newline;

N.addEdge (j, i, weightedEdge(0.1));
print "Should be 1: " + N.isDirected() + newline;

N.clear();
N.cycle(10, 1, kuramoto());
N.randomizeWeights( uniform(3.0, 3.0) );
print "Should be 0: " + N.isDirected() + newline;

Table Of Contents

Previous topic

cycle

Next topic

isLinked