PM_to_DEVS.mvc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. include "primitives.alh"
  2. include "modelling.alh"
  3. include "object_oeprations.alh"
  4. Composite schedule {
  5. {Contains} Success success {}
  6. {Contains} Failure failure {}
  7. {Contains} Atomic add_resource_handler {
  8. LHS {}
  9. RHS {
  10. Post_CDEVS/DEVSInstance post_resource_1 {
  11. label = "1"
  12. value_name = $
  13. String function value(model : Element, name : String, mapping : Element):
  14. return "resource_handler"!
  15. $
  16. value_type = $
  17. String function value(model : Element, name : String, mapping : Element):
  18. return "ResourceHandler"!
  19. $
  20. }
  21. Post_CDEVS/InputPort post_resource_2 {
  22. name = "resource_in"
  23. }
  24. Post_CDEVS/DEVSInstanceToPort (post_resource_1, post_resource_2) {}
  25. Post_CDEVS/OutputPort post_resource_3 {
  26. name = "resource_out"
  27. }
  28. Post_CDEVS/DEVSInstanceToPort (post_resource_1, post_resource_3) {}
  29. }
  30. }
  31. {Contains} ForAll initial {
  32. LHS {
  33. Pre_PM/Initial pre_init_0 {
  34. label = "0"
  35. }
  36. }
  37. RHS {
  38. Post_PM/Initial post_init_0 {
  39. label = "0"
  40. }
  41. Post_CDEVS/DEVSInstance post_init_1 {
  42. label = "1"
  43. value_name = $
  44. String function value(model : Element, name : String, mapping : Element):
  45. return read_attribute(model, mapping["0"], "name")!
  46. $
  47. value_type = $
  48. String function value(model : Element, name : String, mapping : Element):
  49. return "Initial"!
  50. $
  51. }
  52. Trace (post_init_0, post_init_1) {}
  53. Post_CDEVS/OutputPort post_init_2 {
  54. name = "control_out"
  55. }
  56. Post_CDEVS/DEVSInstanceToPort (post_init_1, post_init_2) {}
  57. }
  58. }
  59. {Contains} ForAll finish {
  60. LHS {
  61. Pre_PM/Initial pre_finish_0 {
  62. label = "0"
  63. }
  64. }
  65. RHS {
  66. Post_PM/Initial post_finish_0 {
  67. label = "0"
  68. }
  69. Post_CDEVS/DEVSInstance post_finish_1 {
  70. label = "1"
  71. value_name = $
  72. String function value(model : Element, name : String, mapping : Element):
  73. return read_attribute(model, mapping["0"], "name")!
  74. $
  75. value_type = $
  76. String function value(model : Element, name : String, mapping : Element):
  77. return "Finish"!
  78. $
  79. }
  80. Trace (post_finish_0, post_finish_1) {}
  81. Post_CDEVS/InputPort post_finish_2 {
  82. name = "control_in"
  83. }
  84. Post_CDEVS/DEVSInstanceToPort (post_finish_1, post_finish_2) {}
  85. }
  86. }
  87. {Contains} ForAll activity {
  88. LHS {
  89. Pre_PM/Initial pre_activity_0 {
  90. label = "0"
  91. }
  92. }
  93. RHS {
  94. Post_PM/Initial post_activity_0 {
  95. label = "0"
  96. }
  97. Post_CDEVS/DEVSInstance post_activity_1 {
  98. label = "1"
  99. value_name = $
  100. String function value(model : Element, name : String, mapping : Element):
  101. return read_attribute(model, mapping["0"], "name")!
  102. $
  103. value_type = $
  104. String function value(model : Element, name : String, mapping : Element):
  105. return "Activity"!
  106. $
  107. value_parameters = $
  108. String function value(model : Element, name : String, mapping : Element):
  109. return "[" + cast_value(read_attribute(model, mapping["0"], "name")) + ", " + cast_string(read_attribute(model, mapping["0"], "distribution")) + "]"!
  110. $
  111. }
  112. Trace (post_activity_0, post_activity_1) {}
  113. Post_CDEVS/InputPort post_activity_2 {
  114. name = "resource_in"
  115. }
  116. Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_2) {}
  117. Post_CDEVS/OutputPort post_activity_3 {
  118. name = "resource_out"
  119. }
  120. Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_3) {}
  121. Post_CDEVS/InputPort post_activity_4 {
  122. name = "control_in"
  123. }
  124. Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_4) {}
  125. Post_CDEVS/OutputPort post_activity_5 {
  126. name = "control_out"
  127. }
  128. Post_CDEVS/DEVSInstanceToPort (post_activity_1, post_activity_5) {}
  129. }
  130. }
  131. {Contains} ForAll parallelsplit {
  132. LHS {
  133. Pre_PM/Initial pre_split_0 {
  134. label = "0"
  135. }
  136. }
  137. RHS {
  138. Post_PM/Initial post_split_0 {
  139. label = "0"
  140. }
  141. Post_CDEVS/DEVSInstance post_split_1 {
  142. label = "1"
  143. value_name = $
  144. String function value(model : Element, name : String, mapping : Element):
  145. return read_attribute(model, mapping["0"], "name")!
  146. $
  147. value_type = $
  148. String function value(model : Element, name : String, mapping : Element):
  149. return "ParallelSplit"!
  150. $
  151. }
  152. Trace (post_split_0, post_split_1) {}
  153. Post_CDEVS/InputPort post_split_2 {
  154. name = "control_in"
  155. }
  156. Post_CDEVS/DEVSInstanceToPort (post_split_1, post_split_2) {}
  157. Post_CDEVS/OutputPort post_split_3 {
  158. name = "control_out"
  159. }
  160. Post_CDEVS/DEVSInstanceToPort (post_split_1, post_split_3) {}
  161. }
  162. }
  163. {Contains} ForAll synchronization {
  164. LHS {
  165. Pre_PM/Initial pre_sync_0 {
  166. label = "0"
  167. }
  168. }
  169. RHS {
  170. Post_PM/Initial post_sync_0 {
  171. label = "0"
  172. }
  173. Post_CDEVS/DEVSInstance post_sync_1 {
  174. label = "1"
  175. value_name = $
  176. String function value(model : Element, name : String, mapping : Element):
  177. return read_attribute(model, mapping["0"], "name")!
  178. $
  179. value_type = $
  180. String function value(model : Element, name : String, mapping : Element):
  181. return "Synchronization"!
  182. $
  183. }
  184. Trace (post_sync_0, post_sync_1) {}
  185. Post_CDEVS/InputPort post_sync_2 {
  186. name = "control_in"
  187. }
  188. Post_CDEVS/DEVSInstanceToPort (post_sync_1, post_sync_2) {}
  189. Post_CDEVS/OutputPort post_sync_3 {
  190. name = "control_out"
  191. }
  192. Post_CDEVS/DEVSInstanceToPort (post_sync_1, post_sync_3) {}
  193. }
  194. }
  195. {Contains} ForAll xor {
  196. LHS {
  197. Pre_PM/Initial pre_xor_0 {
  198. label = "0"
  199. }
  200. }
  201. RHS {
  202. Post_PM/Initial post_xor_0 {
  203. label = "0"
  204. }
  205. Post_CDEVS/DEVSInstance post_xor_1 {
  206. label = "1"
  207. value_name = $
  208. String function value(model : Element, name : String, mapping : Element):
  209. return read_attribute(model, mapping["0"], "name")!
  210. $
  211. value_type = $
  212. String function value(model : Element, name : String, mapping : Element):
  213. return "ExclusiveChoice"!
  214. $
  215. }
  216. Trace (post_xor_0, post_xor_1) {}
  217. Post_CDEVS/InputPort post_xor_2 {
  218. name = "control_in"
  219. }
  220. Post_CDEVS/DEVSInstanceToPort (post_xor_1, post_xor_2) {}
  221. Post_CDEVS/OutputPort post_xor_3 {
  222. name = "control_out1"
  223. }
  224. Post_CDEVS/DEVSInstanceToPort (post_xor_1, post_xor_3) {}
  225. Post_CDEVS/OutputPort post_xor_4 {
  226. name = "control_out2"
  227. }
  228. Post_CDEVS/DEVSInstanceToPort (post_xor_1, post_xor_4) {}
  229. }
  230. }
  231. {Contains} ForAll merge {
  232. LHS {
  233. Pre_PM/Initial pre_merge_0 {
  234. label = "0"
  235. }
  236. }
  237. RHS {
  238. Post_PM/Initial post_merge_0 {
  239. label = "0"
  240. }
  241. Post_CDEVS/DEVSInstance post_merge_1 {
  242. label = "1"
  243. value_name = $
  244. String function value(model : Element, name : String, mapping : Element):
  245. return read_attribute(model, mapping["0"], "name")!
  246. $
  247. value_type = $
  248. String function value(model : Element, name : String, mapping : Element):
  249. return "SimpleMerge"!
  250. $
  251. }
  252. Trace (post_merge_0, post_merge_1) {}
  253. Post_CDEVS/InputPort post_merge_2 {
  254. name = "control_in"
  255. }
  256. Post_CDEVS/DEVSInstanceToPort (post_merge_1, post_merge_2) {}
  257. Post_CDEVS/OutputPort post_merge_3 {
  258. name = "control_out"
  259. }
  260. Post_CDEVS/DEVSInstanceToPort (post_merge_1, post_merge_3) {}
  261. }
  262. }
  263. {Contains} ForAll multi {
  264. LHS {
  265. Pre_PM/Initial pre_multi_0 {
  266. label = "0"
  267. }
  268. }
  269. RHS {
  270. Post_PM/Initial post_multi_0 {
  271. label = "0"
  272. }
  273. Post_CDEVS/DEVSInstance post_multi_1 {
  274. label = "1"
  275. value_name = $
  276. String function value(model : Element, name : String, mapping : Element):
  277. return read_attribute(model, mapping["0"], "name")!
  278. $
  279. value_type = $
  280. String function value(model : Element, name : String, mapping : Element):
  281. return "MultiInstance"!
  282. $
  283. value_parameters = $
  284. String function value(model : Element, name : String, mapping : Element):
  285. return "[" + cast_value(read_attribute(model, mapping["0"], "name")) + ", " + cast_string(read_attribute(model, mapping["0"], "nr_instances")) + ", " + cast_string(read_attribute(model, mapping["0"], "distribution")) + "]"!
  286. $
  287. }
  288. Trace (post_multi_0, post_multi_1) {}
  289. Post_CDEVS/InputPort post_multi_2 {
  290. name = "resource_in"
  291. }
  292. Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_2) {}
  293. Post_CDEVS/OutputPort post_multi_3 {
  294. name = "resource_out"
  295. }
  296. Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_3) {}
  297. Post_CDEVS/InputPort post_multi_4 {
  298. name = "control_in"
  299. }
  300. Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_4) {}
  301. Post_CDEVS/OutputPort post_multi_5 {
  302. name = "control_out"
  303. }
  304. Post_CDEVS/DEVSInstanceToPort (post_multi_1, post_multi_5) {}
  305. }
  306. }
  307. }