forked from adam-mcdaniel/program-evolution
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtree_example2.py
More file actions
31 lines (21 loc) · 787 Bytes
/
tree_example2.py
File metadata and controls
31 lines (21 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from treelib import Node, Tree
tree = Tree()
tree.create_node("", "zero") # root node
tree.create_node("", "one", parent="zero")
tree.create_node("K", "K", parent="zero")
tree.create_node("I", "I", parent="one")
tree.create_node("S", "S", parent="one")
tree.show()
tree2 = Tree()
tree2.create_node("", "zero") # root node
tree2.create_node("I", "I0", parent="zero")
tree2.create_node("", "one", parent="zero")
tree2.create_node("", "two", parent="one")
tree2.create_node("K", "K0", parent="two")
tree2.create_node("S", "S0", parent="two")
tree2.create_node("", "three", parent="one")
tree2.create_node("", "four", parent="three")
tree2.create_node("S", "S1", parent="three")
tree2.create_node("K", "K1", parent="four")
tree2.create_node("I", "i1", parent="four")
tree2.show()