|
@@ -906,9 +906,22 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
tokens = 2
|
|
tokens = 2
|
|
executed = False
|
|
executed = False
|
|
}
|
|
}
|
|
|
|
+ Place p3 {
|
|
|
|
+ tokens = 3
|
|
|
|
+ executed = False
|
|
|
|
+ }
|
|
Transition t1 {
|
|
Transition t1 {
|
|
executing = False
|
|
executing = False
|
|
}
|
|
}
|
|
|
|
+ P2T (p1, t1) {
|
|
|
|
+ weight = 1
|
|
|
|
+ }
|
|
|
|
+ P2T (p2, t1) {
|
|
|
|
+ weight = 1
|
|
|
|
+ }
|
|
|
|
+ T2P (t1, p3) {
|
|
|
|
+ weight = 2
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
export pn to models/pn
|
|
export pn to models/pn
|
|
@@ -960,7 +973,7 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
}
|
|
}
|
|
{Contains} Atomic consume {
|
|
{Contains} Atomic consume {
|
|
LHS {
|
|
LHS {
|
|
- Pre_Transition {
|
|
|
|
|
|
+ Pre_Transition lhs_consume_t{
|
|
label = "0"
|
|
label = "0"
|
|
constraint = $
|
|
constraint = $
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
@@ -970,7 +983,7 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
return value_eq(read_attribute(host_model, name, "executing"), True)!
|
|
return value_eq(read_attribute(host_model, name, "executing"), True)!
|
|
$
|
|
$
|
|
}
|
|
}
|
|
- Pre_Place {
|
|
|
|
|
|
+ Pre_Place lhs_consume_p{
|
|
label = "1"
|
|
label = "1"
|
|
constraint = $
|
|
constraint = $
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
@@ -980,15 +993,15 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
return value_eq(read_attribute(host_model, name, "executed"), False)!
|
|
return value_eq(read_attribute(host_model, name, "executed"), False)!
|
|
$
|
|
$
|
|
}
|
|
}
|
|
- Pre_P2T {
|
|
|
|
|
|
+ Pre_P2T lhs_consume_p2t(lhs_consume_p, lhs_consume_t){
|
|
label = "2"
|
|
label = "2"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
RHS {
|
|
RHS {
|
|
- Post_Transition {
|
|
|
|
|
|
+ Post_Transition rhs_consume_t {
|
|
label = "0"
|
|
label = "0"
|
|
}
|
|
}
|
|
- Post_Place {
|
|
|
|
|
|
+ Post_Place rhs_consume_p {
|
|
label = "1"
|
|
label = "1"
|
|
action = $
|
|
action = $
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
@@ -1005,14 +1018,14 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
return!
|
|
return!
|
|
$
|
|
$
|
|
}
|
|
}
|
|
- Post_P2T {
|
|
|
|
|
|
+ Post_P2T (rhs_consume_p, rhs_consume_t){
|
|
label = "2"
|
|
label = "2"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
{Contains} Atomic produce {
|
|
{Contains} Atomic produce {
|
|
LHS {
|
|
LHS {
|
|
- Pre_Transition {
|
|
|
|
|
|
+ Pre_Transition lhs_produce_t{
|
|
label = "0"
|
|
label = "0"
|
|
constraint = $
|
|
constraint = $
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
@@ -1022,7 +1035,7 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
return value_eq(read_attribute(host_model, name, "executing"), True)!
|
|
return value_eq(read_attribute(host_model, name, "executing"), True)!
|
|
$
|
|
$
|
|
}
|
|
}
|
|
- Pre_Place {
|
|
|
|
|
|
+ Pre_Place lhs_produce_p{
|
|
label = "1"
|
|
label = "1"
|
|
constraint = $
|
|
constraint = $
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
@@ -1032,15 +1045,15 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
return value_eq(read_attribute(host_model, name, "executed"), False)!
|
|
return value_eq(read_attribute(host_model, name, "executed"), False)!
|
|
$
|
|
$
|
|
}
|
|
}
|
|
- Pre_T2P {
|
|
|
|
|
|
+ Pre_T2P (lhs_produce_t, lhs_produce_p){
|
|
label = "2"
|
|
label = "2"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
RHS {
|
|
RHS {
|
|
- Post_Transition {
|
|
|
|
|
|
+ Post_Transition rhs_produce_t{
|
|
label = "0"
|
|
label = "0"
|
|
}
|
|
}
|
|
- Post_Place {
|
|
|
|
|
|
+ Post_Place rhs_produce_p{
|
|
label = "1"
|
|
label = "1"
|
|
action = $
|
|
action = $
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
@@ -1057,7 +1070,7 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
return!
|
|
return!
|
|
$
|
|
$
|
|
}
|
|
}
|
|
- Post_T2P {
|
|
|
|
|
|
+ Post_T2P (rhs_produce_t, rhs_produce_p){
|
|
label = "2"
|
|
label = "2"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1082,7 +1095,7 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
include "primitives.alh"
|
|
include "primitives.alh"
|
|
include "modelling.alh"
|
|
include "modelling.alh"
|
|
Void function action(host_model : Element, name : String, mapping : Element):
|
|
Void function action(host_model : Element, name : String, mapping : Element):
|
|
- unset_attribute(host_model, name, "executingd")
|
|
|
|
|
|
+ unset_attribute(host_model, name, "executing")
|
|
instantiate_attribute(host_model, name, "executing", False)
|
|
instantiate_attribute(host_model, name, "executing", False)
|
|
return!
|
|
return!
|
|
$
|
|
$
|
|
@@ -1116,18 +1129,19 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- {Contains} OnSuccess (mark, consume) {}
|
|
|
|
- {Contains} OnFailure (mark, failure) {}
|
|
|
|
- {Contains} OnSuccess (consume, consume) {}
|
|
|
|
- {Contains} OnFailure (consume, produce) {}
|
|
|
|
- {Contains} OnSuccess (produce, produce) {}
|
|
|
|
- {Contains} OnFailure (produce, unmark_transition) {}
|
|
|
|
- {Contains} OnSuccess (unmark_transition, unmark_place) {}
|
|
|
|
- {Contains} OnFailure (unmark_transition, failure) {}
|
|
|
|
- {Contains} OnSuccess (unmark_place, unmark_place) {}
|
|
|
|
- {Contains} OnFailure (unmark_place, success) {}
|
|
|
|
- initial = !mark
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+ OnSuccess (mark, consume) {}
|
|
|
|
+ OnFailure (mark, failure) {}
|
|
|
|
+ OnSuccess (consume, consume) {}
|
|
|
|
+ OnFailure (consume, produce) {}
|
|
|
|
+ OnSuccess (produce, produce) {}
|
|
|
|
+ OnFailure (produce, unmark_transition) {}
|
|
|
|
+ OnSuccess (unmark_transition, unmark_place) {}
|
|
|
|
+ OnFailure (unmark_transition, failure) {}
|
|
|
|
+ OnSuccess (unmark_place, unmark_place) {}
|
|
|
|
+ OnFailure (unmark_place, success) {}
|
|
|
|
+ Initial (schedule, mark) {}
|
|
}
|
|
}
|
|
|
|
|
|
export s to models/pn_simulate
|
|
export s to models/pn_simulate
|
|
@@ -1145,6 +1159,7 @@ Void function action(host_model : Element, name : String, mapping : Element):
|
|
"read", "t1",
|
|
"read", "t1",
|
|
"read", "p1",
|
|
"read", "p1",
|
|
"read", "p2",
|
|
"read", "p2",
|
|
|
|
+ "read", "p3",
|
|
"exit",
|
|
"exit",
|
|
],
|
|
],
|
|
None, "PO"))
|
|
None, "PO"))
|