outputsInDepth method
Returns all the outputs in depth, scanning all the outputs of outputs.
Implementation
List<Node<T>> outputsInDepth(
{int? maxDepth, bool bfs = false, Iterable<Node<T>>? ignore}) {
final allNodes = <Node<T>>[];
var initialProcessedNodes = ignore != null
? Map.fromEntries(ignore.map((e) => MapEntry(e, 1)))
: null;
var graphWalker = GraphWalker<T>(
processRoots: false,
bfs: bfs,
initialProcessedNodes: initialProcessedNodes,
);
graphWalker.walkByNodes<bool>(
[this],
outputsProvider: (step, node) => node._outputs,
process: (step) {
allNodes.add(step.node);
return null;
},
maxDepth: maxDepth,
);
return allNodes;
}