| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547 |
- 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_string(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\timport random\n\t\tif self.state['name'] == 'generating':\n\t\t\treturn random.uniform(0.5, 1.5)"!
- $
- }
- 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_string(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_string(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 = random.uniform(1.5, 2.5)\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_string(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 = random.uniform(1.5, 2.5)\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_string(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\t\t\tself.wait_time = random.uniform(1.5, 2.5)\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_string(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_string(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_string(list_read(string_split(mapping["convbelt"], "/"), 1)) + "_i" + cast_string(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_integer(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_string(list_read(string_split(mapping["convbelt"], "/"), 1)) + "_i" + cast_string(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_value(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))
- log("nr of traceability links: " + cast_string(read_nr_out(allInstances(host_model, "PS2DEVS_instancelink"))))
- 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) {}
|