瀏覽代碼

First iteration of plant_to_EPN (no P2T and T2P links yet)

Yentl Van Tendeloo 8 年之前
父節點
當前提交
35dbdf7fe1
共有 2 個文件被更改,包括 186 次插入1 次删除
  1. 1 1
      models/petrinet_ports.mvc
  2. 185 0
      models/plant_to_EPN.mvc

+ 1 - 1
models/petrinet_ports.mvc

@@ -25,7 +25,7 @@ SimpleClassDiagrams PetriNetsPorts {
                     if (boolean_or(value_eq(model["model"][name], "transition"), value_eq(model["model"][name], "place"))):
                         return "OK"!
                     else:
-                        return "PlaceOrTransition does not contain either Place or Transition"!
+                        return "PlaceOrTransition does not contain either 'place' or 'transition'"!
                 else:
                     return "PlaceOrTransition has non-string value"!
             $

+ 185 - 0
models/plant_to_EPN.mvc

@@ -0,0 +1,185 @@
+PW_PN_RAM pw_to_epn {
+    Composite schedule {
+        {Contains} Success success {}
+        {Contains} Atomic R_no_sensor {
+            LHS {
+                Pre_PW/Side {
+                    label = "1"
+                }
+            }
+            NAC {
+                Pre_PW/Side n_nac_s{
+                    label = "1"
+                }
+                Pre_PW/Infrared n_nac_i{
+                    label = "2"
+                }
+                Pre_PW/HasSensor (n_nac_s, n_nac_i) {
+                    label = "3"
+                }
+            }
+            RHS {
+                Post_EPN/Boundary n_0{
+                    label = "0"
+                }
+
+                Post_EPN/Port n_4{
+                    label = "4"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlGoingDown"!
+                        $
+                }
+                Post_EPN/Port n_6{
+                    label = "6"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlMovingUp"!
+                        $
+                }
+                Post_EPN/Port n_50{
+                    label = "50"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlNeutral"!
+                        $
+                }
+
+                Post_EPN/Transition n_16{
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlMovingUp"!
+                        $
+                }
+                    label = "16"
+                Post_EPN/Transition n_18{
+                    label = "18"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlMovingUp"!
+                        $
+                }
+                Post_EPN/Transition n_20{
+                    label = "20"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlNeutral"!
+                        $
+                }
+                Post_EPN/Transition n_22{
+                    label = "22"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlNeutral"!
+                        $
+                }
+                Post_EPN/Transition n_24{
+                    label = "24"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlNeutral"!
+                        $
+                }
+                Post_EPN/Transition n_26{
+                    label = "26"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlMovingUp"!
+                        $
+                }
+                Post_EPN/Transition n_28{
+                    label = "28"
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "InControlMovingUp"!
+                        $
+                }
+                
+                Post_EPN/Place n_9{
+                    label = "9"
+                    nbTokens = $
+                        Integer function value(host_model : Element, name : String, mapping : Element):
+                            return 0!
+                        $
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "top"!
+                        $
+                }
+                Post_EPN/Place n_11{
+                    label = "11"
+                    nbTokens = $
+                        Integer function value(host_model : Element, name : String, mapping : Element):
+                            return 0!
+                        $
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "middle"!
+                        $
+                }
+                Post_EPN/Place n_14{
+                    label = "14"
+                    nbTokens = $
+                        Integer function value(host_model : Element, name : String, mapping : Element):
+                            return 1!
+                        $
+                    name = $
+                        String function value(host_model : Element, name : String, mapping : Element):
+                            return "bottom"!
+                        $
+                }
+
+                Post_EPN/Has3 (n_0, n_4){
+                    label = "5"
+                }
+                Post_EPN/Has3 (n_0, n_6){
+                    label = "7"
+                }
+                Post_EPN/Has3 (n_0, n_50){
+                    label = "8"
+                }
+
+                Post_EPN/Has2 (n_0, n_16){
+                    label = "17"
+                }
+                Post_EPN/Has2 (n_0, n_18){
+                    label = "19"
+                }
+                Post_EPN/Has2 (n_0, n_20){
+                    label = "21"
+                }
+                Post_EPN/Has2 (n_0, n_22){
+                    label = "23"
+                }
+                Post_EPN/Has2 (n_0, n_24){
+                    label = "25"
+                }
+                Post_EPN/Has2 (n_0, n_26){
+                    label = "27"
+                }
+                Post_EPN/Has2 (n_0, n_28){
+                    label = "29"
+                }
+
+                Post_EPN/Has1 (n_0, n_9){
+                    label = "10"
+                }
+                Post_EPN/Has1 (n_0, n_11){
+                    label = "13"
+                }
+                Post_EPN/Has1 (n_0, n_14){
+                    label = "15"
+                }
+            }
+        }
+        {Contains} Atomic R_sensor {
+
+        }
+    }
+
+    Initial (schedule, R_no_sensor) {}
+    OnSuccess (R_no_sensor, R_no_sensor) {}
+    OnFailure (R_no_sensor, R_sensor) {}
+    OnSuccess (R_sensor, R_sensor) {}
+    OnFailure (R_sensor, success) {}
+}