WIP: Extraction des règles: première approche.
This commit is contained in:
parent
648072f59d
commit
cf5ff788fa
Binary file not shown.
Binary file not shown.
|
@ -378,7 +378,7 @@ class Transition:
|
|||
def get_author(self):
|
||||
return self.node.attrib["author"]
|
||||
|
||||
def get_parent(self):
|
||||
def get_parent_id(self):
|
||||
return self.node.attrib["parent"]
|
||||
|
||||
def get_probability(self):
|
||||
|
|
|
@ -46,7 +46,7 @@ for i in range(0, len(model.testmodel.get_transitions().get_all())):
|
|||
transition = model.testmodel.get_transitions().get_one(i)
|
||||
transitions_set.add(TreeNode(
|
||||
transition.get_id(),
|
||||
transition.get_parent(),
|
||||
transition.get_parent_id(),
|
||||
None, None, None, None, None))
|
||||
|
||||
for i in conditions_set:
|
||||
|
|
|
@ -4,7 +4,14 @@ import rules_tree
|
|||
|
||||
tree = rules_tree.get_tree()
|
||||
|
||||
print('type: ', type(tree))
|
||||
for pre, fill, node in RenderTree(tree):
|
||||
treestr = u"%s%s" % (pre, node.id)
|
||||
print(treestr.ljust(0))
|
||||
|
||||
print('\ntype: ', type(tree))
|
||||
print('path: ', tree.path)
|
||||
print('children: ', tree.children)
|
||||
print('descendants[0]: ', tree.descendants[0])
|
||||
print(tree.depth, ' < depth')
|
||||
print(tree.is_leaf, ' < is_leaf')
|
||||
print(tree.is_root, ' < is_root')
|
||||
|
@ -14,14 +21,12 @@ print(tree.ancestors, ' < ancestors')
|
|||
print(tree.anchestors, ' < anchestors')
|
||||
print(tree.siblings, ' < siblings')
|
||||
print(len(tree.leaves), ' < len(tree.leaves)')
|
||||
print(len(tree.path), ' < len(tree.path)')
|
||||
print('path: ', tree.path)
|
||||
print('children: ', tree.children)
|
||||
print('descendants[0]: ', tree.descendants[0])
|
||||
print(len(tree.path), ' < len(tree.path)\n')
|
||||
|
||||
for pre, fill, node in RenderTree(tree):
|
||||
treestr = u"%s%s" % (pre, node.id)
|
||||
print(treestr.ljust(46))
|
||||
if node.path[len(node.path) - 1].is_leaf:
|
||||
print('at depth', len(node.path),
|
||||
'is rule', node.path[len(node.path) - 1].parent_id)
|
||||
|
||||
print('\nNext step: single rule extraction from tree.',
|
||||
' 😃️\nand learn how to use the Newick format.')
|
||||
|
|
Loading…
Reference in New Issue