Yentl Van Tendeloo 8 éve
szülő
commit
060e28cb82
2 módosított fájl, 14 hozzáadás és 13 törlés
  1. 13 13
      integration/test_mvc.py
  2. 1 0
      interface/HUTN/hutn_compiler/model_visitor.py

+ 13 - 13
integration/test_mvc.py

@@ -1449,23 +1449,23 @@ class TestModelverseCore(unittest.TestCase):
                 "pn_design_to_runtime",
                 "my_pn",
                 "my_pn_runtime",
-                "instantiate", "PetriNets_Runtime/Place", "p1",
-                "attr_add", "p1", "tokens", 1,
-                "attr_add", "p1", "name", "p1",
-                "instantiate", "PetriNets_Runtime/Place", "p2",
+                "instantiate", "PetriNets_Runtime/Place", "1",
+                "attr_add", "1", "tokens", 1,
+                "attr_add", "1", "name", "p1",
+                "instantiate", "PetriNets_Runtime/Place", "2",
                 "attr_add", "p2", "tokens", 2,
                 "attr_add", "p2", "name", "p2",
-                "instantiate", "PetriNets_Runtime/Place", "p3",
+                "instantiate", "PetriNets_Runtime/Place", "3",
                 "attr_add", "p3", "tokens", 3,
                 "attr_add", "p3", "name", "p3",
-                "instantiate", "PetriNets_Runtime/Transition", "t1",
-                "attr_add", "t1", "name", "t1",
-                "instantiate", "PetriNets_Runtime/P2T", "p2t1", "p1", "t1",
-                "attr_add", "p2t1", "weight", 1,
-                "instantiate", "PetriNets_Runtime/P2T", "p2t2", "p2", "t1",
-                "attr_add", "p2t2", "weight", 1,
-                "instantiate", "PetriNets_Runtime/T2P", "t2p", "t1", "p3",
-                "attr_add", "t2p", "weight", 2,
+                "instantiate", "PetriNets_Runtime/Transition", "4",
+                "attr_add", "4", "name", "t1",
+                "instantiate", "PetriNets_Runtime/P2T", "5", "1", "4",
+                "attr_add", "5", "weight", 1,
+                "instantiate", "PetriNets_Runtime/P2T", "6", "2", "4",
+                "attr_add", "6", "weight", 1,
+                "instantiate", "PetriNets_Runtime/T2P", "7", "4", "3",
+                "attr_add", "7", "weight", 2,
                 "exit",
                 "transformation_execute",
                 "pn_step",

+ 1 - 0
interface/HUTN/hutn_compiler/model_visitor.py

@@ -47,6 +47,7 @@ class ModelVisitor(Visitor):
         model_name = children[-1].get_text()
         self.constructors.extend(["instantiate_model", model_type, model_name])
         self.current_model = model_name
+        self.names = set()
         for element in tree.get_children("model_element"):
             self.visit(element)