Commit 1e254ca7 authored by Georgios Dagkakis's avatar Georgios Dagkakis

addition of method to get predecessors of nodes

parent 30df67c9
......@@ -41,6 +41,16 @@ class InputPreparationPlugin(Plugin):
}
return data
# returns the predecessors of a node
def findPredecessors(self, data, node_id):
predecessors=[]
from copy import copy
edges=copy(data['graph']['edge'])
for edge_id,edge in edges.iteritems():
if edge['destination']==node_id:
predecessors.append(edge['source'])
return predecessors
class OutputPreparationPlugin(Plugin):
def postprocess(self, data):
"""Postprocess the data after simulation run.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment