Преглед на файлове

Working PN transformations for simulation

Yentl Van Tendeloo преди 8 години
родител
ревизия
097675c448
променени са 3 файла, в които са добавени 11 реда и са изтрити 7 реда
  1. BIN
      bootstrap/bootstrap.m.gz
  2. 0 1
      bootstrap/random.alc
  3. 11 6
      integration/test_pn_interface.py

BIN
bootstrap/bootstrap.m.gz


+ 0 - 1
bootstrap/random.alc

@@ -17,7 +17,6 @@ Float function random():
 	seed = integer_modulo(a * seed + c, m)
 
 	// The seed is the new value
-	log("Return random " + cast_f2s(float_division(seed, m)))
 	return float_division(seed, m)!
 
 Integer function random_interval(a : Integer, b : Integer):

+ 11 - 6
integration/test_pn_interface.py

@@ -600,6 +600,8 @@ Void function action(host_model : Element, name : String, mapping : Element):
 \tweight = read_attribute(host_model, mapping["2"], "weight")
 \tunset_attribute(host_model, name, "tokens")
 \tinstantiate_attribute(host_model, name, "tokens", tokens - weight)
+\tunset_attribute(host_model, name, "executed")
+\tinstantiate_attribute(host_model, name, "executed", True)
 \treturn!
             """
 
@@ -614,6 +616,8 @@ Void function action(host_model : Element, name : String, mapping : Element):
 \tweight = read_attribute(host_model, mapping["2"], "weight")
 \tunset_attribute(host_model, name, "tokens")
 \tinstantiate_attribute(host_model, name, "tokens", tokens + weight)
+\tunset_attribute(host_model, name, "executed")
+\tinstantiate_attribute(host_model, name, "executed", True)
 \treturn!
             """
 
@@ -805,8 +809,8 @@ Void function action(host_model : Element, name : String, mapping : Element):
                 "instantiate", "RHS_contains", "", "rhs_unmark_transition", "post_unmark_t",
                 # Atomic of rule 4 "unmark transition"
                 "instantiate", "Atomic", "unmark_transition",
-                "instantiate", "AtomicLHS", "", "produce", "lhs_unmark_transition",
-                "instantiate", "AtomicRHS", "", "produce", "rhs_unmark_transition",
+                "instantiate", "AtomicLHS", "", "unmark_transition", "lhs_unmark_transition",
+                "instantiate", "AtomicRHS", "", "unmark_transition", "rhs_unmark_transition",
                 # Rule 5: unmark marked places
                 # LHS
                 "instantiate", "LHS", "lhs_unmark_place",
@@ -824,8 +828,8 @@ Void function action(host_model : Element, name : String, mapping : Element):
                 "instantiate", "RHS_contains", "", "rhs_unmark_place", "post_unmark_p",
                 # Atomic of rule 5 "unmark place"
                 "instantiate", "Atomic", "unmark_place",
-                "instantiate", "AtomicLHS", "", "produce", "lhs_unmark_place",
-                "instantiate", "AtomicRHS", "", "produce", "rhs_unmark_place",
+                "instantiate", "AtomicLHS", "", "unmark_place", "lhs_unmark_place",
+                "instantiate", "AtomicRHS", "", "unmark_place", "rhs_unmark_place",
                 # Compose schedule
                 "instantiate", "Composite", "main",
                 "instantiate", "Success", "success",
@@ -856,8 +860,9 @@ Void function action(host_model : Element, name : String, mapping : Element):
              "load", "pn",
                 "list",
                 "verify",
-                "read",
-                "t1",
+                "read", "t1",
+                "read", "p1",
+                "read", "p2",
                 "exit",
                 ],
             None, "PO"))