23 to create a list of stages, where each sub list is one stage in a process. |
23 to create a list of stages, where each sub list is one stage in a process. |
24 |
24 |
25 The algorithm was taken from Boa Constructor. |
25 The algorithm was taken from Boa Constructor. |
26 |
26 |
27 @param nodes list of nodes to be sorted |
27 @param nodes list of nodes to be sorted |
|
28 @type str |
28 @param routes list of routes between the nodes |
29 @param routes list of routes between the nodes |
|
30 @type list of tuple of (str, str) |
29 @param noRecursion flag indicating, if recursion errors should be raised |
31 @param noRecursion flag indicating, if recursion errors should be raised |
|
32 @type bool |
30 @return list of stages |
33 @return list of stages |
|
34 @rtype list of lists of str |
31 @exception RecursionError a recursion error was detected |
35 @exception RecursionError a recursion error was detected |
32 """ |
36 """ |
33 children, parents = _buildChildrenLists(routes) |
37 children, parents = _buildChildrenLists(routes) |
34 |
38 |
35 # first stage is those nodes having no incoming routes... |
39 # first stage is those nodes having no incoming routes... |
95 Function to build up parent - child relationships. |
99 Function to build up parent - child relationships. |
96 |
100 |
97 Taken from Boa Constructor. |
101 Taken from Boa Constructor. |
98 |
102 |
99 @param routes list of routes between nodes |
103 @param routes list of routes between nodes |
|
104 @type list of tuple of (str, str) |
100 @return dictionary of child and dictionary of parent relationships |
105 @return dictionary of child and dictionary of parent relationships |
|
106 @rtype tuple of (dict, dict) |
101 """ |
107 """ |
102 childrenTable = {} |
108 childrenTable = {} |
103 parentTable = {} |
109 parentTable = {} |
104 for sourceID, destinationID in routes: |
110 for sourceID, destinationID in routes: |
105 currentChildren = childrenTable.get(sourceID, []) |
111 currentChildren = childrenTable.get(sourceID, []) |