| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546 |
- include "primitives.alh"
- include "modelling.alh"
- include "object_operations.alh"
- include "mini_modify.alh"
- Composite schedule {
- {Contains} Success success {}
- {Contains} Failure failure {}
- {Contains} Atomic init {
- LHS {}
- RHS {
- Post_ParallelDEVS/CoupledDEVSBlock {
- label = "root"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "Root"!
- $
- }
- Post_ParallelDEVS/AtomicDEVSBlock init_convbelt {
- label = "convbelt"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ConveyorBelt"!
- $
- value_initialState = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {'name': 'waiting', 'product': None}"!
- $
- value_intTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'transporting':\n\t\t\tself.state['name'] == 'waiting'\n\t\treturn self.state"!
- $
- value_outputFnc = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {self.my_ports['conv_out']: [self.state['product']]}"!
- $
- value_extTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'waiting':\n\t\t\tself.state['product'] = my_inputs[self.my_ports['conv_in']][0]\n\t\t\tself.state['name'] = 'transporting'\n\t\treturn self.state"!
- $
- value_confTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.confTransition(self, my_inputs)"!
- $
- value_timeAdvance = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'waiting':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'transporting':\n\t\t\treturn 1"!
- $
- }
- Post_ParallelDEVS/InputPort init_iport {
- label = "iport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "conv_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(init_convbelt, init_iport) {
- label = "convbelt_to_iport"
- }
- Post_ParallelDEVS/OutputPort init_oport {
- label = "oport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "conv_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(init_convbelt, init_oport) {
- label = "convbelt_to_oport"
- }
- Post_ParallelDEVS/AtomicDEVSBlock init_op {
- label = "op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "Operator"!
- $
- value_initialState = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {'name': 'waiting', 'req_queue': [], 'query_queue': [], 'requester': None}"!
- $
- value_intTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'requested':\n\t\t\tself.state['name'] = 'allocating'\n\t\t\tself.state['requester'] = self.state['req_queue'].pop()\n\t\telif self.state['name'] == 'allocating':\n\t\t\tself.state['name'] = 'allocated'\n\t\tif self.state['query_queue']:\n\t\t\tself.state['query_queue'] = []\n\t\treturn self.state"!
- $
- value_outputFnc = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\toutput = {}\n\t\tif self.state['query_queue']:\n\t\t\toutput[self.my_ports['op_out']] = []\n\t\t\tfor it in self.state['query_queue']:\n\t\t\t\toutput[self.my_ports['op_out']].append({'type': 'response', 'req_name': it, 'op_name': id(self), 'free': self.state['name'] == 'waiting'})\n\t\tif self.state['name'] == 'allocating':\n\t\t\tif self.my_ports['op_out'] in output:\n\t\t\t\toutput[self.my_ports['op_out']].append({'type': 'allocate', 'req_name': self.state['requester'], 'op_name': id(self)})\n\t\t\telse:\n\t\t\t\toutput[self.my_ports['op_out']] = [({'type': 'allocate', 'req_name': self.state['requester'], 'op_name': id(self)})]\n\t\treturn output"!
- $
- value_extTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tmsgs = my_inputs[self.my_ports['op_in']]\n\t\trelease_msgs = [it for it in msgs if it['type'] == 'release' and it['op_name'] == id(self)]\n\t\treq_msgs = [it for it in msgs if it['type'] == 'request' and it['op_name'] == id(self)]\n\t\tquery_msgs = [it for it in msgs if it['type'] == 'query']\n\t\t\n\t\tif release_msgs:\n\t\t\tself.state['name'] = 'requested' if self.state['req_queue'] else 'waiting'\n\t\tfor r_m in req_msgs:\n\t\t\tself.state['req_queue'].append(r_m['req_name'])\n\t\t\tself.state['name'] = 'requested'\n\t\tfor q_m in query_msgs:\n\t\t\tself.state['query_queue'].append(q_m['req_name'])\n\t\treturn self.state"!
- $
- value_confTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.confTransition(self, my_inputs)"!
- $
- value_timeAdvance = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['query_queue']:\n\t\t\treturn 0\n\t\telif self.state['name'] == 'waiting':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'requested':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'allocating':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'allocated':\n\t\t\treturn INFINITY"!
- $
- }
- Post_ParallelDEVS/InputPort init_op_iport {
- label = "op_iport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "op_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(init_op, init_op_iport) {
- label = "op_to_op_iport"
- }
- Post_ParallelDEVS/OutputPort init_op_oport {
- label = "op_oport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "op_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(init_op, init_op_oport) {
- label = "op_to_op_oport"
- }
- }
- }
- {Contains} ForAll gen_to_adevs {
- LHS {
- Pre_ProductionSystem/Generator gen_to_adevs_pre_gen {
- label = "gen"
- }
- Pre_ProductionSystem/Part gen_to_adevs_pre_part {
- label = "part"
- }
- Pre_ProductionSystem/Gen_To_Part(gen_to_adevs_pre_gen, gen_to_adevs_pre_part) {
- label = "gen_to_part"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock gen_to_adevs_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- }
- RHS {
- Post_ProductionSystem/Generator gen_to_adevs_post_gen {
- label = "gen"
- }
- Post_ProductionSystem/Part gen_to_adevs_post_part {
- label = "part"
- }
- Post_ProductionSystem/Gen_To_Part(gen_to_adevs_post_gen, gen_to_adevs_post_part) {
- label = "gen_to_part"
- }
- Post_ParallelDEVS/AtomicDEVSBlock gen_to_adevs_post_adevs {
- label = "adevs"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["gen"], "/"), 1)!
- $
- value_initialState = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {'name': 'generating'}"!
- $
- value_intTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.intTransition(self)"!
- $
- value_outputFnc = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'generating':\n\t\t\tnew_item = {'type': '" + cast_i2s(list_read(string_split(read_type(model, mapping["part"]), "/"), 1)) + "', 'broken': False}\n\t\t\tnew_item['id'] = id(new_item)\n\t\t\treturn {self.my_ports['g_out']: [new_item]}"!
- $
- value_extTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.extTransition(self, my_inputs)"!
- $
- value_confTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.confTransition(self, my_inputs)"!
- $
- value_timeAdvance = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'generating':\n\t\t\treturn 1"!
- $
- }
- Post_ParallelDEVS/OutputPort gen_to_adevs_post_port {
- label = "port"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "g_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(gen_to_adevs_post_adevs, gen_to_adevs_post_port) {
- label = "gen_to_port"
- }
- Post_ParallelDEVS/DEVSInstance gen_to_adevs_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["gen"], "/"), 1)!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["gen"], "/"), 1)) + "_i")!
- $
- }
- Post_ParallelDEVS/OutputPort gen_to_adevs_post_porti {
- label = "porti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "g_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(gen_to_adevs_post_devsi, gen_to_adevs_post_porti) {
- label = "devsi_to_porti"
- }
- Post_ParallelDEVS/CoupledDEVSBlock gen_to_adevs_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(gen_to_adevs_post_root, gen_to_adevs_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_typelink(gen_to_adevs_post_gen, gen_to_adevs_post_adevs) {
- label = "typelink"
- }
- Post_PS2DEVS_instancelink(gen_to_adevs_post_gen, gen_to_adevs_post_devsi) {
- label = "instancelink"
- }
- }
- }
- {Contains} ForAll coll_to_adevs {
- LHS {
- Pre_ProductionSystem/Collector coll_to_adevs_pre_coll {
- label = "coll"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock coll_to_adevs_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- }
- RHS {
- Post_ProductionSystem/Collector coll_to_adevs_post_coll {
- label = "coll"
- }
- Post_ParallelDEVS/AtomicDEVSBlock coll_to_adevs_post_adevs {
- label = "adevs"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["coll"], "/"), 1)!
- $
- value_initialState = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {'name': 'collecting', 'WarAPCs': 0, 'RiotAPCS': 0}"!
- $
- value_intTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.intTransition(self)"!
- $
- value_outputFnc = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.outputFnc(self)"!
- $
- value_extTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif (my_inputs[self.my_ports['c_in']][0]['type'] == 'WarAPC'):\n\t\t\tself.state['WarAPCs'] += 1\n\t\telif (my_inputs[self.my_ports['c_in']][0]['type'] == 'RiotAPC'):\n\t\t\tself.state['RiotAPCs'] += 1\n\t\treturn self.state"!
- $
- value_confTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.confTransition(self, my_inputs)"!
- $
- value_timeAdvance = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'collecting':\n\t\t\treturn INFINITY"!
- $
- }
- Post_ParallelDEVS/InputPort coll_to_adevs_post_port {
- label = "port"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "c_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(coll_to_adevs_post_adevs, coll_to_adevs_post_port) {
- label = "coll_to_port"
- }
- Post_ParallelDEVS/DEVSInstance coll_to_adevs_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["coll"], "/"), 1)!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["coll"], "/"), 1)) + "_i")!
- $
- }
- Post_ParallelDEVS/InputPort coll_to_adevs_post_porti {
- label = "porti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "c_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(coll_to_adevs_post_devsi, coll_to_adevs_post_porti) {
- label = "devsi_to_porti"
- }
- Post_ParallelDEVS/CoupledDEVSBlock coll_to_adevs_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(coll_to_adevs_post_root, coll_to_adevs_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_typelink(coll_to_adevs_post_coll, coll_to_adevs_post_adevs) {
- label = "typelink"
- }
- Post_PS2DEVS_instancelink(coll_to_adevs_post_coll, coll_to_adevs_post_devsi) {
- label = "instancelink"
- }
- }
- }
- {Contains} ForAll ass_to_adevs {
- LHS {
- Pre_ProductionSystem/Assembler ass_to_adevs_pre_ass {
- label = "ass"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock ass_to_adevs_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- }
- RHS {
- Post_ProductionSystem/Assembler ass_to_adevs_post_ass {
- label = "ass"
- }
- Post_ParallelDEVS/AtomicDEVSBlock ass_to_adevs_post_adevs {
- label = "adevs"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["ass"], "/"), 1)!
- $
- value_initialState = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {'name': 'waiting', 'queue': [], 'finishedProduct': None, 'op_name': None, 'op_to_send': None}"!
- $
- value_intTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'producing':\n\t\t\tself.state['name'] = 'waiting'\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\tself.state['name'] = 'waiting_for_op'\n\t\treturn self.state"!
- $
- value_outputFnc = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'producing':\n\t\t\treturn {self.my_ports['ass_out']: [self.state['finishedProduct']], self.my_ports['ass_op_out']: [{'type': 'release', 'op_name': self.state['op_name']}]}\n\t\telif self.state['name'] == 'looking_for_op':\n\t\t\treturn {self.my_ports['ass_op_out']: [{'type': 'query', 'req_name': id(self)}]}\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\treturn {self.my_ports['ass_op_out']: [{'type': 'request', 'req_name': id(self), 'op_name': self.state['op_to_send']}]}\n\t\telse:\n\t\t\treturn AtomicDEVS.outputFnc(self)"!
- $
- value_extTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'producing':\n\t\t\tself.wait_time -= self.elapsed\n\t\t\n\t\timport helpers, random\n\t\tif self.my_ports['ass_in'] in my_inputs:\n\t\t\tself.state['queue'].extend([i['type'] for i in my_inputs[self.my_ports['ass_in']]])\n\t\t\tif (self.state['name'] == 'waiting' and (helpers.canWarAPC(self.state['queue']) or helpers.canRiotAPC(self.state['queue']))):\n\t\t\t\tself.state['name'] = 'looking_for_op'\n\t\tif self.state['name'] == 'looking_for_op' and self.my_ports['ass_op_in'] in my_inputs:\n\t\t\tmsgs = my_inputs[self.my_ports['ass_op_in']]\n\t\t\tfree = [msg['op_name'] for msg in msgs if msg['req_name'] == id(self) and msg['type'] == 'response' and msg['free']]\n\t\t\tnotfree = [msg['op_name'] for msg in msgs if msg['req_name'] == id(self) and msg['type'] == 'response' and not msg['free']]\n\t\t\tif free:\n\t\t\t\tself.state['op_to_send'] = free[0]\n\t\t\telse:\n\t\t\t\tself.state['op_to_send'] = notfree[0]\n\t\t\tself.state['name'] = 'sending_req_to_op'\n\t\telif self.state['name'] == 'waiting_for_op' and self.my_ports['ass_op_in'] in my_inputs:\n\t\t\tforme = [msg for msg in my_inputs[self.my_ports['ass_op_in']] if msg['req_name'] == id(self) and msg['type'] == 'allocate']\n\t\t\tif forme:\n\t\t\t\tself.state['op_name'] = my_inputs[self.my_ports['ass_op_in']][0]['op_name']\n\t\t\t\tif helpers.isWarAPC(self.state['queue']):\n\t\t\t\t\tself.state['finishedProduct'] = {'type': 'WarAPC', 'broken': (random.random() < 0.05)}\n\t\t\t\telif helpers.isRiotAPC(self.state['queue']):\n\t\t\t\t\tself.state['finishedProduct'] = {'type': 'RiotAPC', 'broken': (random.random() < 0.05)}\n\t\t\t\tself.state['name'] = 'producing'\n\t\t\t\tself.wait_time = 2\n\t\treturn self.state"!
- $
- value_confTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.confTransition(self, my_inputs)"!
- $
- value_timeAdvance = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'waiting':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'looking_for_op':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'waiting_for_op':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'producing':\n\t\t\treturn self.wait_time"!
- $
- }
- Post_ParallelDEVS/InputPort ass_to_adevs_post_iport {
- label = "iport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(ass_to_adevs_post_adevs, ass_to_adevs_post_iport) {
- label = "ass_to_iport"
- }
- Post_ParallelDEVS/InputPort ass_to_adevs_post_iport_op {
- label = "iport_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_op_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(ass_to_adevs_post_adevs, ass_to_adevs_post_iport_op) {
- label = "ass_to_iport_op"
- }
- Post_ParallelDEVS/OutputPort ass_to_adevs_post_oport {
- label = "oport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(ass_to_adevs_post_adevs, ass_to_adevs_post_oport) {
- label = "ass_to_oport"
- }
- Post_ParallelDEVS/OutputPort ass_to_adevs_post_oport_op {
- label = "oport_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_op_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(ass_to_adevs_post_adevs, ass_to_adevs_post_oport_op) {
- label = "ass_to_oport_op"
- }
- Post_ParallelDEVS/DEVSInstance ass_to_adevs_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["ass"], "/"), 1)!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["ass"], "/"), 1)) + "_i")!
- $
- }
- Post_ParallelDEVS/InputPort ass_to_adevs_post_iporti {
- label = "iporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(ass_to_adevs_post_devsi, ass_to_adevs_post_iporti) {
- label = "devsi_to_iporti"
- }
- Post_ParallelDEVS/InputPort ass_to_adevs_post_iporti_op {
- label = "iporti_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_op_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(ass_to_adevs_post_devsi, ass_to_adevs_post_iporti_op) {
- label = "devsi_to_iporti_op"
- }
- Post_ParallelDEVS/OutputPort ass_to_adevs_post_oporti {
- label = "oporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(ass_to_adevs_post_devsi, ass_to_adevs_post_oporti) {
- label = "devsi_to_oporti"
- }
- Post_ParallelDEVS/OutputPort ass_to_adevs_post_oporti_op {
- label = "oporti_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "ass_op_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(ass_to_adevs_post_devsi, ass_to_adevs_post_oporti_op) {
- label = "devsi_to_oporti_op"
- }
- Post_ParallelDEVS/CoupledDEVSBlock ass_to_adevs_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(ass_to_adevs_post_root, ass_to_adevs_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_typelink(ass_to_adevs_post_ass, ass_to_adevs_post_adevs) {
- label = "typelink"
- }
- Post_PS2DEVS_instancelink(ass_to_adevs_post_ass, ass_to_adevs_post_devsi) {
- label = "instancelink"
- }
- }
- }
- {Contains} ForAll rep_to_adevs {
- LHS {
- Pre_ProductionSystem/Repair rep_to_adevs_pre_ass {
- label = "rep"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock rep_to_adevs_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- }
- RHS {
- Post_ProductionSystem/Repair rep_to_adevs_post_ass {
- label = "rep"
- }
- Post_ParallelDEVS/AtomicDEVSBlock rep_to_adevs_post_adevs {
- label = "adevs"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["rep"], "/"), 1)!
- $
- value_initialState = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {'name': 'waiting', 'item': None, 'op_to_send': None, 'op_name': None}"!
- $
- value_intTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'repairing':\n\t\t\tself.state['name'] = 'waiting'\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\tself.state['name'] = 'waiting_for_op'\n\t\treturn self.state"!
- $
- value_outputFnc = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'repairing':\n\t\t\treturn {self.my_ports['rep_out']: [self.state['item']], self.my_ports['rep_op_out']: [{'type': 'release', 'op_name': self.state['op_name']}]}\n\t\telif self.state['name'] == 'looking_for_op':\n\t\t\treturn {self.my_ports['rep_op_out']: [{'type': 'query', 'req_name': id(self)}]}\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\treturn {self.my_ports['rep_op_out']: [{'type': 'request', 'req_name': id(self), 'op_name': self.state['op_to_send']}]}\n\t\telse:\n\t\t\treturn AtomicDEVS.outputFnc(self)"!
- $
- value_extTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'repairing':\n\t\t\tself.wait_time -= self.elapsed\n\t\t\n\t\tif self.state['name'] == 'waiting' and self.my_ports['rep_in'] in my_inputs:\n\t\t\tself.state['item'] = my_inputs[self.my_ports['rep_in']][0]\n\t\t\tself.state['name'] = 'looking_for_op'\n\t\telif self.state['name'] == 'looking_for_op' and self.my_ports['rep_op_in'] in my_inputs:\n\t\t\tmsgs = my_inputs[self.my_ports['rep_op_in']]\n\t\t\tfree = [msg['op_name'] for msg in msgs if msg['req_name'] == id(self) and msg['type'] == 'response' and msg['free']]\n\t\t\tnotfree = [msg['op_name'] for msg in msgs if msg['req_name'] == id(self) and msg['type'] == 'response' and not msg['free']]\n\t\t\tif free:\n\t\t\t\tself.state['op_to_send'] = free[0]\n\t\t\telse:\n\t\t\t\tself.state['op_to_send'] = notfree[0]\n\t\t\tself.state['name'] = 'sending_req_to_op'\n\t\telif self.state['name'] == 'waiting_for_op' and self.my_ports['rep_op_in'] in my_inputs:\n\t\t\tforme = [msg for msg in my_inputs[self.my_ports['rep_op_in']] if msg['req_name'] == id(self) and msg['type'] == 'allocate']\n\t\t\tif forme:\n\t\t\t\tself.state['op_name'] = my_inputs[self.my_ports['rep_op_in']][0]['op_name']\t\t\t\t\n\t\t\t\tself.state['item']['broken'] = False\n\t\t\t\tself.state['name'] = 'repairing'\n\t\t\t\tself.wait_time = 2\n\t\treturn self.state"!
- $
- value_confTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.confTransition(self, my_inputs)"!
- $
- value_timeAdvance = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'waiting':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'looking_for_op':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'waiting_for_op':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'repairing':\n\t\t\treturn self.wait_time"!
- $
- }
- Post_ParallelDEVS/InputPort rep_to_adevs_post_iport {
- label = "iport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(rep_to_adevs_post_adevs, rep_to_adevs_post_iport) {
- label = "rep_to_iport"
- }
- Post_ParallelDEVS/InputPort rep_to_adevs_post_iport_op {
- label = "iport_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_op_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(rep_to_adevs_post_adevs, rep_to_adevs_post_iport_op) {
- label = "rep_to_iport_op"
- }
- Post_ParallelDEVS/OutputPort rep_to_adevs_post_oport {
- label = "oport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(rep_to_adevs_post_adevs, rep_to_adevs_post_oport) {
- label = "rep_to_oport"
- }
- Post_ParallelDEVS/OutputPort rep_to_adevs_post_oport_op {
- label = "oport_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_op_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(rep_to_adevs_post_adevs, rep_to_adevs_post_oport_op) {
- label = "rep_to_oport_op"
- }
- Post_ParallelDEVS/DEVSInstance rep_to_adevs_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["rep"], "/"), 1)!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["rep"], "/"), 1)) + "_i")!
- $
- }
- Post_ParallelDEVS/InputPort rep_to_adevs_post_iporti {
- label = "iporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(rep_to_adevs_post_devsi, rep_to_adevs_post_iporti) {
- label = "devsi_to_iporti"
- }
- Post_ParallelDEVS/InputPort rep_to_adevs_post_iporti_op {
- label = "iporti_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_op_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(rep_to_adevs_post_devsi, rep_to_adevs_post_iporti_op) {
- label = "devsi_to_iporti_op"
- }
- Post_ParallelDEVS/OutputPort rep_to_adevs_post_oporti {
- label = "oporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(rep_to_adevs_post_devsi, rep_to_adevs_post_oporti) {
- label = "devsi_to_oporti"
- }
- Post_ParallelDEVS/OutputPort rep_to_adevs_post_oporti_op {
- label = "oporti_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "rep_op_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(rep_to_adevs_post_devsi, rep_to_adevs_post_oporti_op) {
- label = "devsi_to_oporti_op"
- }
- Post_ParallelDEVS/CoupledDEVSBlock rep_to_adevs_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(rep_to_adevs_post_root, rep_to_adevs_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_typelink(rep_to_adevs_post_ass, rep_to_adevs_post_adevs) {
- label = "typelink"
- }
- Post_PS2DEVS_instancelink(rep_to_adevs_post_ass, rep_to_adevs_post_devsi) {
- label = "instancelink"
- }
- }
- }
- {Contains} ForAll qc_to_adevs {
- LHS {
- Pre_ProductionSystem/QualityControl qc_to_adevs_pre_qc {
- label = "qc"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock qc_to_adevs_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- }
- RHS {
- Post_ProductionSystem/QualityControl qc_to_adevs_post_qc {
- label = "qc"
- }
- Post_ParallelDEVS/AtomicDEVSBlock qc_to_adevs_post_adevs {
- label = "adevs"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["qc"], "/"), 1)!
- $
- value_initialState = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn {'name': 'waiting', 'item': None}"!
- $
- value_intTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'checking':\n\t\t\tself.state['name'] = 'waiting'\n\t\telif self.state['name'] == 'looking_for_op':\n\t\t\tself.state['name'] = 'waiting_for_op_query_answer'\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\tself.state['name'] = 'waiting_for_op'\n\t\treturn self.state"!
- $
- value_outputFnc = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'checking':\n\t\t\tif self.state['item']['broken']:\n\t\t\t\treturn {self.my_ports['qc_out_broken']: [self.state['item']], self.my_ports['qc_op_out']: [{'type': 'release', 'op_name': self.state['op_name']}]}\n\t\t\telse:\n\t\t\t\treturn {self.my_ports['qc_out_working']: [self.state['item']], self.my_ports['qc_op_out']: [{'type': 'release', 'op_name': self.state['op_name']}]}\n\t\telif self.state['name'] == 'looking_for_op':\n\t\t\treturn {self.my_ports['qc_op_out']: [{'type': 'query', 'req_name': id(self)}]}\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\treturn {self.my_ports['qc_op_out']: [{'type': 'request', 'req_name': id(self), 'op_name': self.state['op_to_send']}]}\n\t\telse:\n\t\t\treturn AtomicDEVS.outputFnc(self)"!
- $
- value_extTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'repairing':\n\t\t\tself.wait_time -= self.elapsed\n\t\t\n\t\tif self.state['name'] == 'waiting' and self.my_ports['qc_in'] in my_inputs:\n\t\t\tself.state['item'] = my_inputs[self.my_ports['qc_in']][0]\n\t\t\tself.state['name'] = 'looking_for_op'\n\t\telif self.state['name'] == 'waiting_for_op_query_answer' and self.my_ports['qc_op_in'] in my_inputs:\n\t\t\tmsgs = my_inputs[self.my_ports['qc_op_in']]\n\t\t\tfree = [msg['op_name'] for msg in msgs if msg['req_name'] == id(self) and msg['type'] == 'response' and msg['free']]\n\t\t\tnotfree = [msg['op_name'] for msg in msgs if msg['req_name'] == id(self) and msg['type'] == 'response' and not msg['free']]\n\t\t\tif free:\n\t\t\t\tself.state['op_to_send'] = free[0]\n\t\t\telse:\n\t\t\t\tself.state['op_to_send'] = notfree[0]\n\t\t\tself.state['name'] = 'sending_req_to_op'\n\t\telif self.state['name'] == 'waiting_for_op' and self.my_ports['qc_op_in'] in my_inputs:\n\t\t\tforme = [msg for msg in my_inputs[self.my_ports['qc_op_in']] if msg['req_name'] == id(self) and msg['type'] == 'allocate']\n\t\t\tif forme:\n\t\t\t\tself.state['name'] = 'checking'\n\t\treturn self.state"!
- $
- value_confTransition = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\treturn AtomicDEVS.confTransition(self, my_inputs)"!
- $
- value_timeAdvance = $
- String function value(model : Element, name : String, mapping : Element):
- return "\t\tif self.state['name'] == 'waiting':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'looking_for_op':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'sending_req_to_op':\n\t\t\treturn 0\n\t\telif self.state['name'] == 'waiting_for_op_query_answer':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'waiting_for_op':\n\t\t\treturn INFINITY\n\t\telif self.state['name'] == 'checking':\n\t\t\treturn self.wait_time"!
- $
- }
- Post_ParallelDEVS/InputPort qc_to_adevs_post_iport {
- label = "iport"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(qc_to_adevs_post_adevs, qc_to_adevs_post_iport) {
- label = "qc_to_iport"
- }
- Post_ParallelDEVS/InputPort qc_to_adevs_post_iport_op {
- label = "iport_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_op_in"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(qc_to_adevs_post_adevs, qc_to_adevs_post_iport_op) {
- label = "qc_to_iport_op"
- }
- Post_ParallelDEVS/OutputPort qc_to_adevs_post_oport_broken {
- label = "oport_broken"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_out_broken"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(qc_to_adevs_post_adevs, qc_to_adevs_post_oport_broken) {
- label = "qc_to_oport_broken"
- }
- Post_ParallelDEVS/OutputPort qc_to_adevs_post_oport_working {
- label = "oport_working"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_out_working"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(qc_to_adevs_post_adevs, qc_to_adevs_post_oport_working) {
- label = "qc_to_oport_working"
- }
- Post_ParallelDEVS/OutputPort qc_to_adevs_post_oport_op {
- label = "oport_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_op_out"!
- $
- }
- Post_ParallelDEVS/DEVSBlockToPort(qc_to_adevs_post_adevs, qc_to_adevs_post_oport_op) {
- label = "qc_to_oport_op"
- }
- Post_ParallelDEVS/DEVSInstance qc_to_adevs_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return list_read(string_split(mapping["qc"], "/"), 1)!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["qc"], "/"), 1)) + "_i")!
- $
- }
- Post_ParallelDEVS/InputPort qc_to_adevs_post_iporti {
- label = "iporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(qc_to_adevs_post_devsi, qc_to_adevs_post_iporti) {
- label = "devsi_to_iporti"
- }
- Post_ParallelDEVS/OutputPort qc_to_adevs_post_oport_brokeni {
- label = "oport_brokeni"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_out_broken"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(qc_to_adevs_post_devsi, qc_to_adevs_post_oport_brokeni) {
- label = "devsi_to_oport_brokeni"
- }
- Post_ParallelDEVS/OutputPort qc_to_adevs_post_oport_workingi {
- label = "oport_workingi"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_out_working"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(qc_to_adevs_post_devsi, qc_to_adevs_post_oport_workingi) {
- label = "devsi_to_oport_workingi"
- }
- Post_ParallelDEVS/InputPort qc_to_adevs_post_iporti_op {
- label = "iporti_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_op_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(qc_to_adevs_post_devsi, qc_to_adevs_post_iporti_op) {
- label = "devsi_to_iporti_op"
- }
- Post_ParallelDEVS/OutputPort qc_to_adevs_post_oporti_op {
- label = "oporti_op"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "qc_op_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(qc_to_adevs_post_devsi, qc_to_adevs_post_oporti_op) {
- label = "devsi_to_oporti_op"
- }
- Post_ParallelDEVS/CoupledDEVSBlock qc_to_adevs_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(qc_to_adevs_post_root, qc_to_adevs_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_typelink(qc_to_adevs_post_qc, qc_to_adevs_post_adevs) {
- label = "typelink"
- }
- Post_PS2DEVS_instancelink(qc_to_adevs_post_qc, qc_to_adevs_post_devsi) {
- label = "instancelink"
- }
- }
- }
- {Contains} ForAll op_to_adevs {
- LHS {
- Pre_ProductionSystem/Operator op_to_adevs_pre_op {
- label = "op"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock op_to_adevs_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- }
- RHS {
- Post_ProductionSystem/Operator op_to_adevs_post_op {
- label = "op"
- }
- Post_ParallelDEVS/DEVSInstance op_to_adevs_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return "Operator"!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["op"], "/"), 1)) + "_i")!
- $
- }
- Post_ParallelDEVS/InputPort op_to_adevs_post_iporti {
- label = "iporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "op_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(op_to_adevs_post_devsi, op_to_adevs_post_iporti) {
- label = "devsi_to_iporti"
- }
- Post_ParallelDEVS/OutputPort op_to_adevs_post_oporti {
- label = "oporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "op_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(op_to_adevs_post_devsi, op_to_adevs_post_oporti) {
- label = "devsi_to_oporti"
- }
- Post_ParallelDEVS/CoupledDEVSBlock op_to_adevs_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(op_to_adevs_post_root, op_to_adevs_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_instancelink(op_to_adevs_post_op, op_to_adevs_post_devsi) {
- label = "instancelink"
- }
- }
- }
- {Contains} ForAll connect_op_to_machine {
- LHS {
- Pre_ProductionSystem/Machine connect_op_to_machine_pre_machine {
- label = "machine"
- }
- Pre_ProductionSystem/Operator connect_op_to_machine_pre_op {
- label = "op"
- }
- Pre_ParallelDEVS/DEVSInstance connect_op_to_machine_pre_devsmachine {
- label = "devsmachine"
- }
- Pre_ParallelDEVS/DEVSInstance connect_op_to_machine_pre_devsop {
- label = "devsop"
- }
- Pre_ParallelDEVS/OutputPort connect_op_to_machine_pre_devsmachine_oport {
- label = "devsmachine_oport"
- constraint_name = $
- Boolean function constraint(value: String):
- if (value == "ass_op_out"):
- return True!
- if (value == "qc_op_out"):
- return True!
- if (value == "rep_op_out"):
- return True!
- return False!
- $
- }
- Pre_ParallelDEVS/InputPort connect_op_to_machine_pre_devsmachine_iport {
- label = "devsmachine_iport"
- constraint_name = $
- Boolean function constraint(value: String):
- if (value == "ass_op_in"):
- return True!
- if (value == "qc_op_in"):
- return True!
- if (value == "rep_op_in"):
- return True!
- return False!
- $
- }
- Pre_ParallelDEVS/OutputPort connect_op_to_machine_pre_devsop_oport {
- label = "devsop_oport"
- }
- Pre_ParallelDEVS/InputPort connect_op_to_machine_pre_devsop_iport {
- label = "devsop_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_pre_devsmachine, connect_op_to_machine_pre_devsmachine_oport) {
- label = "devsmachine_to_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_pre_devsmachine, connect_op_to_machine_pre_devsmachine_iport) {
- label = "devsmachine_to_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_pre_devsop, connect_op_to_machine_pre_devsop_oport) {
- label = "devsop_to_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_pre_devsop, connect_op_to_machine_pre_devsop_iport) {
- label = "devsop_to_iport"
- }
- Pre_PS2DEVS_instancelink(connect_op_to_machine_pre_machine, connect_op_to_machine_pre_devsmachine) {
- label = "machine_instancelink"
- }
- Pre_PS2DEVS_instancelink(connect_op_to_machine_pre_op, connect_op_to_machine_pre_devsop) {
- label = "op_instancelink"
- }
- }
- RHS {
- Post_ProductionSystem/Machine connect_op_to_machine_post_machine {
- label = "machine"
- }
- Post_ProductionSystem/Operator connect_op_to_machine_post_op {
- label = "op"
- }
- Post_ParallelDEVS/DEVSInstance connect_op_to_machine_post_devsmachine {
- label = "devsmachine"
- }
- Post_ParallelDEVS/DEVSInstance connect_op_to_machine_post_devsop {
- label = "devsop"
- }
- Post_ParallelDEVS/OutputPort connect_op_to_machine_post_devsmachine_oport {
- label = "devsmachine_oport"
- }
- Post_ParallelDEVS/InputPort connect_op_to_machine_post_devsmachine_iport {
- label = "devsmachine_iport"
- }
- Post_ParallelDEVS/OutputPort connect_op_to_machine_post_devsop_oport {
- label = "devsop_oport"
- }
- Post_ParallelDEVS/InputPort connect_op_to_machine_post_devsop_iport {
- label = "devsop_iport"
- }
- Post_ParallelDEVS/Channel(connect_op_to_machine_post_devsmachine_oport, connect_op_to_machine_post_devsop_iport) {
- label = "channel"
- }
- Post_ParallelDEVS/Channel(connect_op_to_machine_post_devsop_oport, connect_op_to_machine_post_devsmachine_iport) {
- label = "channel2"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_post_devsmachine, connect_op_to_machine_post_devsmachine_oport) {
- label = "devsmachine_to_oport"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_post_devsmachine, connect_op_to_machine_post_devsmachine_iport) {
- label = "devsmachine_to_iport"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_post_devsop, connect_op_to_machine_post_devsop_oport) {
- label = "devsop_to_oport"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_op_to_machine_post_devsop, connect_op_to_machine_post_devsop_iport) {
- label = "devsop_to_iport"
- }
- Post_PS2DEVS_instancelink(connect_op_to_machine_post_machine, connect_op_to_machine_post_devsmachine) {
- label = "machine_instancelink"
- }
- Post_PS2DEVS_instancelink(connect_op_to_machine_post_op, connect_op_to_machine_post_devsop) {
- label = "op_instancelink"
- }
- }
- }
- {Contains} ForAll convbelt_to_adevs_init {
- LHS {
- Pre_ProductionSystem/ConveyorBelt convbelt_to_adevs_init_pre_convbelt {
- label = "convbelt"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock convbelt_to_adevs_init_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- }
- RHS {
- Post_ProductionSystem/ConveyorBelt convbelt_to_adevs_init_post_convbelt {
- label = "convbelt"
- }
- Post_ParallelDEVS/DEVSInstance convbelt_to_adevs_init_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return "ConveyorBelt"!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["convbelt"], "/"), 1)) + "_i" + cast_i2s(set_len(allOutgoingAssociationInstances(model, mapping["convbelt"], "PS2DEVS_instancelink"))))!
- $
- }
- Post_ParallelDEVS/InputPort convbelt_to_adevs_init_post_iporti {
- label = "iporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "conv_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_init_post_devsi, convbelt_to_adevs_init_post_iporti) {
- label = "devsi_to_iporti"
- }
- Post_ParallelDEVS/OutputPort convbelt_to_adevs_init_post_oporti {
- label = "oporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "conv_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_init_post_devsi, convbelt_to_adevs_init_post_oporti) {
- label = "devsi_to_oporti"
- }
- Post_ParallelDEVS/CoupledDEVSBlock convbelt_to_adevs_init_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(convbelt_to_adevs_init_post_root, convbelt_to_adevs_init_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_instancelink(convbelt_to_adevs_init_post_convbelt, convbelt_to_adevs_init_post_devsi) {
- label = "instancelink"
- }
- }
- }
- {Contains} Atomic convbelt_to_adevs_next {
- LHS {
- Pre_ProductionSystem/ConveyorBelt convbelt_to_adevs_next_pre_convbelt {
- label = "convbelt"
- }
- Pre_ParallelDEVS/DEVSInstance convbelt_to_adevs_next_pre_prev {
- label = "prev"
- }
- Pre_ParallelDEVS/OutputPort convbelt_to_adevs_next_pre_prev_oport {
- label = "prev_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_next_pre_prev, convbelt_to_adevs_next_pre_prev_oport) {
- label = "prev_to_prev_oport"
- }
- Pre_PS2DEVS_instancelink(convbelt_to_adevs_next_pre_convbelt, convbelt_to_adevs_next_pre_prev) {
- label = "prev_instancelink"
- }
- Pre_ParallelDEVS/CoupledDEVSBlock convbelt_to_adevs_next_pre_root {
- label = "root"
- constraint_name = $
- Boolean function constraint(value: String):
- return (value == "Root")!
- $
- }
- constraint = $
- Boolean function constraint(model : Element, mapping : Element):
- return (set_len(allOutgoingAssociationInstances(model, mapping["convbelt"], "PS2DEVS_instancelink")) < cast_s2i(read_attribute(model, mapping["convbelt"], "capacity")))!
- $
- }
- NAC {
- Pre_ParallelDEVS/DEVSInstance convbelt_to_adevs_next_nac_prev {
- label = "prev"
- }
- Pre_ParallelDEVS/DEVSInstance convbelt_to_adevs_next_nac_next {
- label = "next"
- }
- Pre_ParallelDEVS/OutputPort convbelt_to_adevs_next_nac_prev_oport {
- label = "prev_oport"
- }
- Pre_ParallelDEVS/InputPort convbelt_to_adevs_next_nac_next_iport {
- label = "next_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_next_nac_prev, convbelt_to_adevs_next_nac_prev_oport) {
- label = "prev_to_prev_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_next_nac_next, convbelt_to_adevs_next_nac_next_iport) {
- label = "nac_pre_next_to_next_iport"
- }
- Pre_ParallelDEVS/Channel(convbelt_to_adevs_next_nac_prev_oport, convbelt_to_adevs_next_nac_next_iport) {
- label = "nac_oport_to_iport"
- }
- }
- RHS {
- Post_ProductionSystem/ConveyorBelt convbelt_to_adevs_next_post_convbelt {
- label = "convbelt"
- }
- Post_ParallelDEVS/DEVSInstance convbelt_to_adevs_next_post_prev {
- label = "prev"
- }
- Post_ParallelDEVS/OutputPort convbelt_to_adevs_next_post_prev_oport {
- label = "prev_oport"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_next_post_prev, convbelt_to_adevs_next_post_prev_oport) {
- label = "prev_to_prev_oport"
- }
- Post_PS2DEVS_instancelink(convbelt_to_adevs_next_post_convbelt, convbelt_to_adevs_next_post_prev) {
- label = "prev_instancelink"
- }
- Post_ParallelDEVS/DEVSInstance convbelt_to_adevs_next_post_devsi {
- label = "devsi"
- value_type = $
- String function value(model : Element, name : String, mapping : Element):
- return "ConveyorBelt"!
- $
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return (cast_i2s(list_read(string_split(mapping["convbelt"], "/"), 1)) + "_i" + cast_i2s(set_len(allOutgoingAssociationInstances(model, mapping["convbelt"], "PS2DEVS_instancelink"))))!
- $
- }
- Post_ParallelDEVS/InputPort convbelt_to_adevs_next_post_iporti {
- label = "iporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "conv_in"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_next_post_devsi, convbelt_to_adevs_next_post_iporti) {
- label = "devsi_to_iporti"
- }
- Post_ParallelDEVS/OutputPort convbelt_to_adevs_next_post_oporti {
- label = "oporti"
- value_name = $
- String function value(model : Element, name : String, mapping : Element):
- return "conv_out"!
- $
- }
- Post_ParallelDEVS/DEVSInstanceToPort(convbelt_to_adevs_next_post_devsi, convbelt_to_adevs_next_post_oporti) {
- label = "devsi_to_oporti"
- }
- Post_ParallelDEVS/Channel(convbelt_to_adevs_next_post_prev_oport, convbelt_to_adevs_next_post_iporti) {
- label = "oporti_to_iporti"
- }
- Post_ParallelDEVS/CoupledDEVSBlock convbelt_to_adevs_next_post_root {
- label = "root"
- }
- Post_ParallelDEVS/SubModel(convbelt_to_adevs_next_post_root, convbelt_to_adevs_next_post_devsi) {
- label = "root_to_devsi"
- }
- Post_PS2DEVS_instancelink(convbelt_to_adevs_next_post_convbelt, convbelt_to_adevs_next_post_devsi) {
- label = "instancelink"
- }
- action = $
- Void function action(host_model: Element, mapping: Element):
- log('ConveyorBelt next...')
- log(cast_v2s(set_len(allOutgoingAssociationInstances(host_model, mapping["convbelt"], "PS2DEVS_instancelink"))))
- return!
- $
- }
- }
- {Contains} ForAll connect_machine_to_convbelt {
- LHS {
- Pre_ProductionSystem/Machine connect_machine_to_convbelt_pre_machine {
- label = "machine"
- }
- Pre_ProductionSystem/ConveyorBelt connect_machine_to_convbelt_pre_convbelt {
- label = "convbelt"
- }
- Pre_ProductionSystem/M_To_Conv(connect_machine_to_convbelt_pre_machine, connect_machine_to_convbelt_pre_convbelt) {
- label = "m_to_conv"
- }
- Pre_ParallelDEVS/DEVSInstance connect_machine_to_convbelt_pre_devsmachine {
- label = "devsmachine"
- }
- Pre_ParallelDEVS/DEVSInstance connect_machine_to_convbelt_pre_devsconvbelt {
- label = "devsconvbelt"
- }
- Pre_ParallelDEVS/OutputPort connect_machine_to_convbelt_pre_devsmachine_oport {
- label = "devsmachine_oport"
- constraint_name = $
- Boolean function constraint(value: String):
- if (value == "ass_out"):
- return True!
- if (value == "qc_out_working"):
- return True!
- if (value == "rep_out"):
- return True!
- if (value == "g_out"):
- return True!
- return False!
- $
- }
- Pre_ParallelDEVS/InputPort connect_machine_to_convbelt_pre_devsconvbelt_iport {
- label = "devsconvbelt_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_machine_to_convbelt_pre_devsmachine, connect_machine_to_convbelt_pre_devsmachine_oport) {
- label = "devsmachine_to_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_machine_to_convbelt_pre_devsconvbelt, connect_machine_to_convbelt_pre_devsconvbelt_iport) {
- label = "devsconvbelt_to_iport"
- }
- Pre_PS2DEVS_instancelink(connect_machine_to_convbelt_pre_machine, connect_machine_to_convbelt_pre_devsmachine) {
- label = "machine_instancelink"
- }
- Pre_PS2DEVS_instancelink(connect_machine_to_convbelt_pre_convbelt, connect_machine_to_convbelt_pre_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- }
- NAC {
- Pre_ProductionSystem/ConveyorBelt connect_machine_to_convbelt_nac_convbelt {
- label = "convbelt"
- }
- Pre_ParallelDEVS/DEVSInstance connect_machine_to_convbelt_nac_devsconvbelt {
- label = "devsconvbelt"
- }
- Pre_PS2DEVS_instancelink(connect_machine_to_convbelt_nac_convbelt, connect_machine_to_convbelt_nac_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- Pre_ParallelDEVS/DEVSInstance connect_machine_to_convbelt_nac_devsconvbelt2 {
- label = "devsconvbelt2"
- }
- Pre_PS2DEVS_instancelink(connect_machine_to_convbelt_nac_convbelt, connect_machine_to_convbelt_nac_devsconvbelt2) {
- label = "convbelt_instancelink2"
- }
- Pre_ParallelDEVS/InputPort connect_machine_to_convbelt_nac_devsconvbelt_iport {
- label = "devsconvbelt_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_machine_to_convbelt_nac_devsconvbelt, connect_machine_to_convbelt_nac_devsconvbelt_iport) {
- label = "devsconvbelt_to_iport"
- }
- Pre_ParallelDEVS/OutputPort connect_machine_to_convbelt_nac_devsconvbelt2_oport {
- label = "devsconvbelt2_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_machine_to_convbelt_nac_devsconvbelt2, connect_machine_to_convbelt_nac_devsconvbelt2_oport) {
- label = "devsconvbelt2_to_oport"
- }
- Pre_ParallelDEVS/Channel(connect_machine_to_convbelt_nac_devsconvbelt2_oport, connect_machine_to_convbelt_nac_devsconvbelt_iport) {
- label = "convbelt_channel"
- }
- }
- RHS {
- Post_ProductionSystem/Machine connect_machine_to_convbelt_post_machine {
- label = "machine"
- }
- Post_ProductionSystem/ConveyorBelt connect_machine_to_convbelt_post_convbelt {
- label = "convbelt"
- }
- Post_ProductionSystem/M_To_Conv(connect_machine_to_convbelt_post_machine, connect_machine_to_convbelt_post_convbelt) {
- label = "m_to_conv"
- }
- Post_ParallelDEVS/DEVSInstance connect_machine_to_convbelt_post_devsmachine {
- label = "devsmachine"
- }
- Post_ParallelDEVS/DEVSInstance connect_machine_to_convbelt_post_devsconvbelt {
- label = "devsconvbelt"
- }
- Post_ParallelDEVS/OutputPort connect_machine_to_convbelt_post_devsmachine_oport {
- label = "devsmachine_oport"
- }
- Post_ParallelDEVS/InputPort connect_machine_to_convbelt_post_devsconvbelt_iport {
- label = "devsconvbelt_iport"
- }
- Post_ParallelDEVS/Channel(connect_machine_to_convbelt_post_devsmachine_oport, connect_machine_to_convbelt_post_devsconvbelt_iport) {
- label = "channel"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_machine_to_convbelt_post_devsmachine, connect_machine_to_convbelt_post_devsmachine_oport) {
- label = "devsmachine_to_oport"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_machine_to_convbelt_post_devsconvbelt, connect_machine_to_convbelt_post_devsconvbelt_iport) {
- label = "devsconvbelt_to_iport"
- }
- Post_PS2DEVS_instancelink(connect_machine_to_convbelt_post_machine, connect_machine_to_convbelt_post_devsmachine) {
- label = "machine_instancelink"
- }
- Post_PS2DEVS_instancelink(connect_machine_to_convbelt_post_convbelt, connect_machine_to_convbelt_post_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- }
- }
- {Contains} ForAll connect_qc_to_convbelt {
- LHS {
- Pre_ProductionSystem/QualityControl connect_qc_to_convbelt_pre_machine {
- label = "qc"
- }
- Pre_ProductionSystem/ConveyorBelt connect_qc_to_convbelt_pre_convbelt {
- label = "convbelt"
- }
- Pre_ProductionSystem/QC_To_Conv(connect_qc_to_convbelt_pre_machine, connect_qc_to_convbelt_pre_convbelt) {
- label = "qc_to_conv"
- }
- Pre_ParallelDEVS/DEVSInstance connect_qc_to_convbelt_pre_devsmachine {
- label = "devsmachine"
- }
- Pre_ParallelDEVS/DEVSInstance connect_qc_to_convbelt_pre_devsconvbelt {
- label = "devsconvbelt"
- }
- Pre_ParallelDEVS/OutputPort connect_qc_to_convbelt_pre_devsmachine_oport {
- label = "devsmachine_oport"
- constraint_name = $
- Boolean function constraint(value: String):
- if (value == "qc_out_broken"):
- return True!
- return False!
- $
- }
- Pre_ParallelDEVS/InputPort connect_qc_to_convbelt_pre_devsconvbelt_iport {
- label = "devsconvbelt_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_qc_to_convbelt_pre_devsmachine, connect_qc_to_convbelt_pre_devsmachine_oport) {
- label = "devsmachine_to_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_qc_to_convbelt_pre_devsconvbelt, connect_qc_to_convbelt_pre_devsconvbelt_iport) {
- label = "devsconvbelt_to_iport"
- }
- Pre_PS2DEVS_instancelink(connect_qc_to_convbelt_pre_machine, connect_qc_to_convbelt_pre_devsmachine) {
- label = "machine_instancelink"
- }
- Pre_PS2DEVS_instancelink(connect_qc_to_convbelt_pre_convbelt, connect_qc_to_convbelt_pre_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- }
- NAC {
- Pre_ProductionSystem/ConveyorBelt connect_qc_to_convbelt_nac_convbelt {
- label = "convbelt"
- }
- Pre_ParallelDEVS/DEVSInstance connect_qc_to_convbelt_nac_devsconvbelt {
- label = "devsconvbelt"
- }
- Pre_PS2DEVS_instancelink(connect_qc_to_convbelt_nac_convbelt, connect_qc_to_convbelt_nac_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- Pre_ParallelDEVS/DEVSInstance connect_qc_to_convbelt_nac_devsconvbelt2 {
- label = "devsconvbelt2"
- }
- Pre_PS2DEVS_instancelink(connect_qc_to_convbelt_nac_convbelt, connect_qc_to_convbelt_nac_devsconvbelt2) {
- label = "convbelt_instancelink2"
- }
- Pre_ParallelDEVS/InputPort connect_qc_to_convbelt_nac_devsconvbelt_iport {
- label = "devsconvbelt_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_qc_to_convbelt_nac_devsconvbelt, connect_qc_to_convbelt_nac_devsconvbelt_iport) {
- label = "devsconvbelt_to_iport"
- }
- Pre_ParallelDEVS/OutputPort connect_qc_to_convbelt_nac_devsconvbelt2_oport {
- label = "devsconvbelt2_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_qc_to_convbelt_nac_devsconvbelt2, connect_qc_to_convbelt_nac_devsconvbelt2_oport) {
- label = "devsconvbelt2_to_oport"
- }
- Pre_ParallelDEVS/Channel(connect_qc_to_convbelt_nac_devsconvbelt2_oport, connect_qc_to_convbelt_nac_devsconvbelt_iport) {
- label = "convbelt_channel"
- }
- }
- RHS {
- Post_ProductionSystem/QualityControl connect_qc_to_convbelt_post_machine {
- label = "qc"
- }
- Post_ProductionSystem/ConveyorBelt connect_qc_to_convbelt_post_convbelt {
- label = "convbelt"
- }
- Post_ProductionSystem/M_To_Conv(connect_qc_to_convbelt_post_machine, connect_qc_to_convbelt_post_convbelt) {
- label = "qc_to_conv"
- }
- Post_ParallelDEVS/DEVSInstance connect_qc_to_convbelt_post_devsmachine {
- label = "devsmachine"
- }
- Post_ParallelDEVS/DEVSInstance connect_qc_to_convbelt_post_devsconvbelt {
- label = "devsconvbelt"
- }
- Post_ParallelDEVS/OutputPort connect_qc_to_convbelt_post_devsmachine_oport {
- label = "devsmachine_oport"
- }
- Post_ParallelDEVS/InputPort connect_qc_to_convbelt_post_devsconvbelt_iport {
- label = "devsconvbelt_iport"
- }
- Post_ParallelDEVS/Channel(connect_qc_to_convbelt_post_devsmachine_oport, connect_qc_to_convbelt_post_devsconvbelt_iport) {
- label = "channel"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_qc_to_convbelt_post_devsmachine, connect_qc_to_convbelt_post_devsmachine_oport) {
- label = "devsmachine_to_oport"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_qc_to_convbelt_post_devsconvbelt, connect_qc_to_convbelt_post_devsconvbelt_iport) {
- label = "devsconvbelt_to_iport"
- }
- Post_PS2DEVS_instancelink(connect_qc_to_convbelt_post_machine, connect_qc_to_convbelt_post_devsmachine) {
- label = "machine_instancelink"
- }
- Post_PS2DEVS_instancelink(connect_qc_to_convbelt_post_convbelt, connect_qc_to_convbelt_post_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- }
- }
- {Contains} ForAll connect_convbelt_to_machine {
- LHS {
- Pre_ProductionSystem/ConveyorBelt connect_convbelt_to_machine_pre_convbelt {
- label = "convbelt"
- }
- Pre_ProductionSystem/Machine connect_convbelt_to_machine_pre_machine {
- label = "machine"
- }
- Pre_ProductionSystem/Conv_To_M(connect_convbelt_to_machine_pre_convbelt, connect_convbelt_to_machine_pre_machine) {
- label = "conv_to_m"
- }
- Pre_ParallelDEVS/DEVSInstance connect_convbelt_to_machine_pre_devsconvbelt {
- label = "devsconvbelt"
- }
- Pre_ParallelDEVS/DEVSInstance connect_convbelt_to_machine_pre_devsmachine {
- label = "devsmachine"
- }
- Pre_ParallelDEVS/OutputPort connect_convbelt_to_machine_pre_devsconvbelt_oport {
- label = "devsconvbelt_oport"
- }
- Pre_ParallelDEVS/InputPort connect_convbelt_to_machine_pre_devsmachine_iport {
- label = "devsmachine_iport"
- constraint_name = $
- Boolean function constraint(value: String):
- if (value == "ass_in"):
- return True!
- if (value == "qc_in"):
- return True!
- if (value == "rep_in"):
- return True!
- if (value == "c_in"):
- return True!
- return False!
- $
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_convbelt_to_machine_pre_devsconvbelt, connect_convbelt_to_machine_pre_devsconvbelt_oport) {
- label = "devsconvbelt_to_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_convbelt_to_machine_pre_devsmachine, connect_convbelt_to_machine_pre_devsmachine_iport) {
- label = "devsmachine_to_iport"
- }
- Pre_PS2DEVS_instancelink(connect_convbelt_to_machine_pre_convbelt, connect_convbelt_to_machine_pre_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- Pre_PS2DEVS_instancelink(connect_convbelt_to_machine_pre_machine, connect_convbelt_to_machine_pre_devsmachine) {
- label = "machine_instancelink"
- }
- }
- NAC {
- Pre_ProductionSystem/ConveyorBelt connect_convbelt_to_machine_nac_convbelt {
- label = "convbelt"
- }
- Pre_ParallelDEVS/DEVSInstance connect_convbelt_to_machine_nac_devsconvbelt {
- label = "devsconvbelt"
- }
- Pre_PS2DEVS_instancelink(connect_convbelt_to_machine_nac_convbelt, connect_convbelt_to_machine_nac_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- Pre_ParallelDEVS/DEVSInstance connect_convbelt_to_machine_nac_devsconvbelt2 {
- label = "devsconvbelt2"
- }
- Pre_PS2DEVS_instancelink(connect_convbelt_to_machine_nac_convbelt, connect_convbelt_to_machine_nac_devsconvbelt2) {
- label = "convbelt_instancelink2"
- }
- Pre_ParallelDEVS/OutputPort connect_convbelt_to_machine_nac_devsconvbelt_oport {
- label = "devsconvbelt_oport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_convbelt_to_machine_nac_devsconvbelt, connect_convbelt_to_machine_nac_devsconvbelt_oport) {
- label = "devsconvbelt_to_oport"
- }
- Pre_ParallelDEVS/InputPort connect_convbelt_to_machine_nac_devsconvbelt2_iport {
- label = "devsconvbelt2_iport"
- }
- Pre_ParallelDEVS/DEVSInstanceToPort(connect_convbelt_to_machine_nac_devsconvbelt2, connect_convbelt_to_machine_nac_devsconvbelt2_iport) {
- label = "devsconvbelt2_to_iport"
- }
- Pre_ParallelDEVS/Channel(connect_convbelt_to_machine_nac_devsconvbelt_oport, connect_convbelt_to_machine_nac_devsconvbelt2_iport) {
- label = "convbelt_channel"
- }
- }
- RHS {
- Post_ProductionSystem/ConveyorBelt connect_convbelt_to_machine_post_convbelt {
- label = "convbelt"
- }
- Post_ProductionSystem/Machine connect_convbelt_to_machine_post_machine {
- label = "machine"
- }
- Post_ProductionSystem/Conv_To_M(connect_convbelt_to_machine_post_convbelt, connect_convbelt_to_machine_post_machine) {
- label = "conv_to_m"
- }
- Post_ParallelDEVS/DEVSInstance connect_convbelt_to_machine_post_devsconvbelt {
- label = "devsconvbelt"
- }
- Post_ParallelDEVS/DEVSInstance connect_convbelt_to_machine_post_devsmachine {
- label = "devsmachine"
- }
- Post_ParallelDEVS/OutputPort connect_convbelt_to_machine_post_devsconvbelt_oport {
- label = "devsconvbelt_oport"
- }
- Post_ParallelDEVS/InputPort connect_convbelt_to_machine_post_devsmachine_iport {
- label = "devsmachine_iport"
- }
- Post_ParallelDEVS/Channel(connect_convbelt_to_machine_post_devsconvbelt_oport, connect_convbelt_to_machine_post_devsmachine_iport) {
- label = "channel"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_convbelt_to_machine_post_devsconvbelt, connect_convbelt_to_machine_post_devsconvbelt_oport) {
- label = "devsconvbelt_to_oport"
- }
- Post_ParallelDEVS/DEVSInstanceToPort(connect_convbelt_to_machine_post_devsmachine, connect_convbelt_to_machine_post_devsmachine_iport) {
- label = "devsmachine_to_iport"
- }
- Post_PS2DEVS_instancelink(connect_convbelt_to_machine_post_machine, connect_convbelt_to_machine_post_devsmachine) {
- label = "machine_instancelink"
- }
- Post_PS2DEVS_instancelink(connect_convbelt_to_machine_post_convbelt, connect_convbelt_to_machine_post_devsconvbelt) {
- label = "convbelt_instancelink"
- }
- }
- }
- {Contains} Atomic finish {
- LHS {}
- RHS {
- action = $
- Void function action(host_model: Element, mapping: Element):
- //log(pretty_print(host_model))
- return!
- $
- }
- }
- }
- Initial (schedule, init) {}
- OnSuccess (init, gen_to_adevs) {}
- OnSuccess (gen_to_adevs, coll_to_adevs) {}
- OnSuccess (coll_to_adevs, ass_to_adevs) {}
- OnSuccess (ass_to_adevs, rep_to_adevs) {}
- OnSuccess (rep_to_adevs, qc_to_adevs) {}
- OnSuccess (qc_to_adevs, op_to_adevs) {}
- OnSuccess (op_to_adevs, connect_op_to_machine) {}
- OnSuccess (connect_op_to_machine, convbelt_to_adevs_init) {}
- OnSuccess (convbelt_to_adevs_init, convbelt_to_adevs_next) {}
- OnSuccess (convbelt_to_adevs_next, convbelt_to_adevs_next) {}
- OnFailure (convbelt_to_adevs_next, connect_machine_to_convbelt) {}
- OnSuccess (connect_machine_to_convbelt, connect_qc_to_convbelt) {}
- OnSuccess (connect_qc_to_convbelt, connect_convbelt_to_machine) {}
- OnSuccess (connect_convbelt_to_machine, finish) {}
- OnSuccess (finish, success) {}
- OnFailure (init, gen_to_adevs) {}
- OnFailure (gen_to_adevs, coll_to_adevs) {}
- OnFailure (coll_to_adevs, ass_to_adevs) {}
- OnFailure (ass_to_adevs, rep_to_adevs) {}
- OnFailure (rep_to_adevs, qc_to_adevs) {}
- OnFailure (qc_to_adevs, op_to_adevs) {}
- OnFailure (op_to_adevs, connect_op_to_machine) {}
- OnFailure (connect_op_to_machine, convbelt_to_adevs_init) {}
- OnFailure (convbelt_to_adevs_init, connect_machine_to_convbelt) {}
- OnFailure (connect_machine_to_convbelt, connect_qc_to_convbelt) {}
- OnFailure (connect_qc_to_convbelt, connect_convbelt_to_machine) {}
- OnFailure (connect_convbelt_to_machine, finish) {}
- OnFailure (finish, failure) {}
|