diff --git a/schemas/models_0.2.1.xmls b/schemas/models_0.2.1.xmls
index 669244b..edbd775 100644
--- a/schemas/models_0.2.1.xmls
+++ b/schemas/models_0.2.1.xmls
@@ -36,8 +36,8 @@
-
-
+
+
@@ -112,14 +112,14 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/__pycache__/model.cpython-39.pyc b/src/__pycache__/model.cpython-39.pyc
index 6002d34..79fb21d 100644
Binary files a/src/__pycache__/model.cpython-39.pyc and b/src/__pycache__/model.cpython-39.pyc differ
diff --git a/src/glimpse.py b/src/glimpse.py
index 8af6934..7543494 100644
--- a/src/glimpse.py
+++ b/src/glimpse.py
@@ -3,23 +3,31 @@ from anytree import Node, AnyNode, NodeMixin, RenderTree
from anytree.exporter import DotExporter
from ete3 import Tree
-cset = {(0,0,'root')} # TODO 1) get_node_self_id <> pas de doublon
- # TODO 2) un node_parent_id existe toujours
+# TODO Contrôles de cohérence des données
+# 1) node_id <> pas de doublon
+# 2) pas de node sans un node_parent_id
-for i in range (0, len(model.testmodel.get_conditions().get_condition_array())):
+conditions_set = set()
+
+for i in range (0, len(model.testmodel.get_conditions().get_conditions_array())):
cnd = model.testmodel.get_conditions().get_condition(i)
- cset.add((cnd.get_node_self_id(), cnd.get_node_parent_id(), cnd.get_weight())) # TODO coord
-
+ conditions_set.add((cnd.get_node_self_id(),
+ cnd.get_node_parent_id(),
+ cnd.get_coord("x"),
+# TODO cnd.get_coord("y"),...
+ cnd.get_site(),
+ cnd.get_weight()))
class TreeNode(object):
- def __init__(self, id, parent, weight, coord):
+ def __init__(self, id, parent, x, site, weight):
self.id = id
self.parent = parent
- self.children = None
- self.weight = weight
- self.coord = coord
self.ch = []
+ self.x = x
+# TODO self.y = y,...
+ self.site = site
+ self.weight = weight
def id(self): return id
@@ -27,24 +35,20 @@ class TreeNode(object):
self.ch.append(ch_id)
self.ch = sorted(self.ch, key=id)
-
l = []
-tnn = TreeNode(0, 0, 0, 0)
-
-for i in cset: # sorted(cset, key=id):
- cndt = TreeNode(i[0], i[1], i[2], 0)
+for i in conditions_set: # sorted(conditions_set, key=id):
+ cndt = TreeNode(i[0], i[1], i[2], i[3], i[4]) # TODO y,z,...
l.append(cndt)
for i in l:
for j in l:
if (i.id == j.parent):
i.add_child(j)
- else:
- i.add_child(tnn)
for i in l:
- print(i.id,' ',i.parent,' [',i.ch[0].id,' ',i.ch[1].id,' ',i.ch[2].id,' ',i.ch[3].id,' ',i.ch[4].id,']')
+ cnd = str(i.id) + ' ' + str(i.parent) + ' [' + str(len(i.ch)) + ']'
+ print(cnd)
@@ -53,30 +57,32 @@ for i in l:
+
+
+
+
+
+
+
+
+"""
##
-
-
-
-
-
-
-
-
-
-
sp = model.testmodel.get_states().get_space(0)
size = model.testmodel.get_parameters().spaceparam.get_dimension().get_x()
nb_sites = int (model.testmodel.get_parameters().spaceparam.get_site_multiplicity())
nb_arrows = int (model.testmodel.get_states().get_space(0).get_nb_arrows())
weight = int (model.testmodel.get_states().get_space(0).get_arrow(0).get_weight())
-# TODO Contrôles cohérence des données (module à prévoir)
- # pour condition et arrow : weight < weight_max (à définir)
- # pour condition et arrow : arrow.site < site_multiplicity
- # pour condition et arrow : arrow.x < space-param.dimension.x (idem autres axes)
- # condition.parent <= condition.node_id max value (donc deux lectures)
+# TODO Contrôles de cohérence des données
+# condition et arrow
+# 1) weight < weight_max (à définir)
+# 2) arrow.site < site_multiplicity
+# 3) arrow.x < space-param.dimension.x (idem autres axes)
+# condition
+# 1) parent <= condition.node_id max value (donc deux lectures)
+# 2) pas de node sans un node_parent_id
space = []
cells = []
@@ -116,4 +122,4 @@ print (cells)
print()
print (space)
-
+"""
diff --git a/src/model.py b/src/model.py
index 3328bc7..0c09a78 100644
--- a/src/model.py
+++ b/src/model.py
@@ -263,6 +263,7 @@ class Condition:
self.node = node
def get_coord(self, axis):
+# print(self.node.get(axis))
return int(self.node.get(axis))
def set_coord(self, axis, value):
@@ -305,7 +306,7 @@ class Conditions:
def get_condition(self, i):
return self.__conditions[i]
- def get_condition_array(self):
+ def get_conditions_array(self):
return self.__conditions
class Transition:
@@ -333,7 +334,7 @@ class Transitions:
def get_transition(self, i):
return self.__transitions[i]
- def get_transition_array(self):
+ def get_transitiosn_array(self):
return self.__transitions
## Model