import models/RAM_PetriNets_Design_Runtime as RAM_PN_DR RAM_PN_DR annotate { Composite schedule { {Contains} Failure failure {} {Contains} Success success {} {Contains} ForAll copy_transitions { LHS { Pre_SOURCE_Transition { label = "0" } } RHS { Post_SOURCE_Transition ct1 { label = "0" } Post_TARGET_Transition ct2 { label = "1" action = $ include "primitives.alh" include "modelling.alh" Void function action(host_model : Element, name : String, mapping : Element): instantiate_attribute(host_model, name, "executing", False) return! $ } Post_TransitionLink (ct1, ct2){ label = "2" } } } {Contains} ForAll copy_places { LHS { Pre_SOURCE_Place { label = "0" } } RHS { Post_SOURCE_Place cp1 { label = "0" } Post_TARGET_Place cp2 { label = "1" action = $ include "primitives.alh" include "modelling.alh" Void function action(host_model : Element, name : String, mapping : Element): instantiate_attribute(host_model, name, "tokens", read_attribute(host_model, mapping["0"], "tokens")) instantiate_attribute(host_model, name, "name", mapping["0"]) return! $ } Post_PlaceLink (cp1, cp2){ label = "2" } } } {Contains} ForAll copy_P2T { LHS { Pre_SOURCE_Place cp2t_p{ label = "0" } Pre_SOURCE_Transition cp2t_t{ label = "1" } Pre_SOURCE_P2T (cp2t_p, cp2t_t){ label = "2" } Pre_TARGET_Place cp2t_p2{ label = "3" } Pre_TARGET_Transition cp2t_t2{ label = "4" } Pre_PlaceLink (cp2t_p, cp2t_p2){ label = "5" } Pre_TransitionLink (cp2t_t, cp2t_t2){ label = "6" } } RHS { Post_SOURCE_Place rhs_cp2t_p{ label = "0" } Post_SOURCE_Transition rhs_cp2t_t{ label = "1" } Post_SOURCE_P2T rhs_cp2t_p2t (rhs_cp2t_p, rhs_cp2t_t){ label = "2" } Post_TARGET_Place rhs_cp2t_p2 { label = "3" } Post_TARGET_Transition rhs_cp2t_t2 { label = "4" } Post_PlaceLink (rhs_cp2t_p, rhs_cp2t_p2){ label = "5" } Post_TransitionLink (rhs_cp2t_t, rhs_cp2t_t2){ label = "6" } Post_TARGET_P2T rhs_cp2t_p2t2(rhs_cp2t_p2, rhs_cp2t_t2) { label = "7" action = $ include "primitives.alh" include "modelling.alh" Void function action(host_model : Element, name : String, mapping : Element): instantiate_attribute(host_model, name, "weight", read_attribute(host_model, mapping["2"], "weight")) return! $ } } } {Contains} ForAll copy_T2P { LHS { Pre_SOURCE_Place ct2p_p{ label = "0" } Pre_SOURCE_Transition ct2p_t{ label = "1" } Pre_SOURCE_T2P (ct2p_t, ct2p_p){ label = "2" } Pre_TARGET_Place ct2p_p2{ label = "3" } Pre_TARGET_Transition ct2p_t2{ label = "4" } Pre_PlaceLink (ct2p_p, ct2p_p2){ label = "5" } Pre_TransitionLink (ct2p_t, ct2p_t2){ label = "6" } } RHS { Post_SOURCE_Place rhs_ct2p_p{ label = "0" } Post_SOURCE_Transition rhs_ct2p_t{ label = "1" } Post_SOURCE_T2P (rhs_ct2p_t, rhs_ct2p_p){ label = "2" } Post_TARGET_Place rhs_ct2p_p2 { label = "3" } Post_TARGET_Transition rhs_ct2p_t2 { label = "4" } Post_PlaceLink (rhs_ct2p_p, rhs_ct2p_p2){ label = "5" } Post_TransitionLink (rhs_ct2p_t, rhs_ct2p_t2){ label = "6" } Post_TARGET_T2P (rhs_ct2p_t2, rhs_ct2p_p2) { label = "7" action = $ include "primitives.alh" include "modelling.alh" Void function action(host_model : Element, name : String, mapping : Element): instantiate_attribute(host_model, name, "weight", read_attribute(host_model, mapping["2"], "weight")) return! $ } } } } OnSuccess (copy_places, copy_transitions) {} OnSuccess (copy_transitions, copy_P2T) {} OnSuccess (copy_P2T, copy_T2P) {} OnSuccess (copy_T2P, success) {} OnFailure (copy_places, copy_transitions) {} OnFailure (copy_transitions, copy_P2T) {} OnFailure (copy_P2T, copy_T2P) {} OnFailure (copy_T2P, success) {} Initial (schedule, copy_places) {} } export annotate to models/pn_annotate