From 29c8d0c127e40b78873ca489338129cef33bcfe1 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sat, 8 Jan 2022 19:41:35 +0100 Subject: [PATCH] WIP: plus simple, plus propre. ( ;- )) --- src/__pycache__/model.cpython-39.pyc | Bin 19517 -> 19477 bytes src/model.py | 8 +++--- src/rules_tree.py | 37 ++++++++++++--------------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/__pycache__/model.cpython-39.pyc b/src/__pycache__/model.cpython-39.pyc index 330ff4efc6d5a4200b9104cdf7db72f945a1c0e0..d4dd9304d428f0f87453132ebc8152edfb25ed43 100644 GIT binary patch delta 229 zcmdlxgK_E%M&3kTUM>b8_<8nbBKt;OHDf*Q^wg60;?$h9_{b8a7w - -for i in conditions_set: - if (i.parent_node_id == 0): - root = i - for i in conditions_set: for j in conditions_set: - if ((i != j) & (i.parent_node_id == j.id)): + if ((i != j) & (i.parent_id == j.id)): i.add_parent_node(j) for condition_node in LevelOrderIter(root): if condition_node.is_leaf: for transition_node in transitions_set: - if (str(condition_node.id) == transition_node.parent): + if (str(condition_node.id) == transition_node.parent_id): transition_node.add_parent_leaf_node(condition_node) for pre, fill, node in RenderTree(root): @@ -76,7 +71,7 @@ for pre, fill, node in RenderTree(root): if (type(node) == CondTreeNode): print(treestr.ljust(16), node.weight, ' arrow(s) at [site', node.site, 'in cell', node.x, end='') - if (not node.depth == 2): + if (not node.depth == 2): # tree.depth() print(end=']\n') else: print('] > ', node.children[0].id, end='\n')