I have a class called Node
class Node: def __init__(self,name, childList, parentList): self.name = name
I have a list of nodes (nodeList). These nodes can be in the parent lists of others or in child lists. I want to be able to visualize the relationship between nodes dictated by their child lists and parent lists on stdout (as an ASCII picture).
for example, where the names below are the names of the nodes in the List node.
Classifier | | FeatureCombiner / \ / \ / \ FeatureGenerator1 FeatureGenerator2 \ / \ / \ / \ / \ / \ / \ / Image Loader
The classifier has an empty parent list and a child list of length 1 containing FeatureCombiner. FeatureGenerator1 and 2 have the same parent and child elements containing FeatureCombiner and Image Loader respectively. Image Loader has an empty child list and a parent list containing FeatureGenerator1 and 2.
Thanks in advance, Matt
aultbot
source share