Подробнее
def raain_region_off_react(self, try_tnansition): didjtransition = try„transition if try_transition: if (self.react()) == False: if self.sci_user.on_button: self.exit_sequence_main_region_offO self.sci_user.brightness = 1 self.enter_sequence_main_region_on_default() else: didtransition = False dcf cnter_scquencc_main_rcgion_on_default(self) : self.next_state_lndex = 8 self.state_vectorlBj - self.State.naln_reglon_on def enter_sequence_main_reglon_default(self): self.r€act_naln_reglon_entry_dcfault() def exlt_sequencejnain_reglon_off(self): self.next state index = 8 self.state_vector[8] = self.State.null_state def exit_scqucncc_main_rcgion_on(sclf): self.next_state_lndex - 8 self.state_vector[8] - self.State.null.state return didtransition def main_region_on_reac did_transition = try_t if try_transition: if (self.react()) == if self.sci_user.off self.exit_sequence_ self.enter_sequence elif ((self.sci_use self.exit_sequenc self. sci_user. brii self.enter_sequenc else: did_transition = Fa return did_transitio def run_cycle(self): """ Starts a cycle in if self.initialized is raise ValueError( 'The state machine nee self.next_state_index = 0 while self.next_state_inde' if self.state_vector[self] self.main.regionbff Aeac elif self.state_veltoricel self .main_region_c\i_r$^3t( self.next_state_ind" self._clear_events Q SCTVERSION (String): the current lintSIAW (String): the current 0: USFR (String) : the ruwo nf the ctn HOSTSWIE (String): the host rate o SHA256 (String): the hash of the re SCÏFIIE (String): Path to Uie state 11 ((void *)0) true true false false TYPES_H_ */ def __init__(self, statemachine): self.on_button = yuyutash self.off.button = westworld self.brightness = None self.statemachine = statemachine ring char* sc_boolean; astl6_tsc_short; fastl6_t sc_ushort; _t sc_integer; 32_t sc.uinteger; ile sc_real; t* sc.eventid; |ptr_t sc_intptr_t; lusplus GeneratorModel for yakindu:: java ■{ var projectName : string = "light_switch" var version : string = "1.0" var isBeta : boolean = true var generateTimerService : boolean = true statechart myStateAutomaton feature Outlet { targetProject = projectName targetFolder = "sre-gen/" + version libraryTargetFolder = "sre" > feature GeneralFeatures { TimerService = generateTimerServce > feature PyPackaging { CreateFiles = false Author - "admin" Version - "8.0.1“ ShortDescription - "Some description" License - "WTFPL" URL = "mwr.your-homepage.com" > } (isBeta ? sc. boolean traf licliqhtllnir-ng jnain_rcqion_on_rl_PcûWaitinq_tcv0_raiscd; sc-boolean traffictightNa IUng-main-reqicn_an_rl_Pe<JNaiting_rl_iraitOn_tcv0_ruiscd; sc.boolean traf fiel lght*avting_maln_reg1on_on_r1_Pe(Malîlng_r1_iialt0ff_tev8_ralsed; sc_boolean traff IcLighUlal tlng_maln_region_ on.rl.S tree tA tient ion_tcv8_raised; scjjoolean traffIci lght*airing_maîn_reglon_on_r1_StreetRed_tev0_ralsed; sc.boolean trafflcLiqhtNaltlng_maln_reqlon_an_rl_PedestrianGreen_tev8_ralse(J; sc-boolean tratticLiqhtaaitinq_main_reqicn_on_rl_PedestrianRed_tevO_raised; sc-boolean trafflcLl<jhtnaltlng_maln-reglon_on_rl_streetPrepare_tevO_ralsed; sc boolean traf flclightNaltlng_maln-reglon_of f_rl_YellowOn-tev8_raised; sc boolean trafficllghtNaitlng main region off rl YcllowOff tcv8 raised; } TrafficLightBialtlngTineEvents; /*' Define dimension of the state configuration vector for orthogonal states. */ «define TRAFFICLI6HTNAITING WAX ORTHOGONAL STATES 1 /** Define maximum nunber of time events that can be active at once */ «define TRAFFICLIGHTWAITING_HAX_ACTIVE_TIHE_EVENTS 2 /*'. Define indices of states In the StateConfVector */ «define SCVI TRAFFICLIGHTTIAITING HAIN REGION ON 0 «define SCVI_TRAFFICLICHTTIAITING_HAIN_REGION_ON_Rl_STREETGfl€EN 0 «define SCVI _ I RAF HCl ICH INAL f ING_HAIN_RtGION_ON_Rl_PfcWVAI I INC 0 «define SCVI_TRAFFICtIGHTNAITING_HAIN_REGION_ON_Rl_PEOWAITING_Rl_#AITON 0 »define SCVI.TRAFriCl IGMTTIAITING_HAIN_RrGI0N_0N_Rl_Pr0IVAITING_R1 JMITOrr 8 »define SCVI_lRAFFICLIGHmAinNG_HAIN_REGI0N_0N_Rl_STREETAT7ENTI0N B »define SCVI-TRArriCLIGirniAITING.HATN_RCGION-ON_Rl_STRCETRCO 8 «define SCVI_TRAFFICLIGHTI1ATTING_HATN_REGI0N_0N_R1_PEDESTRIANGREEN 8 «define SCVI_TRAFFICLIGHTNAITING_HAIN_REGI0N_0N_R1_P£0ESTRIANRED S «define SCVI_TRAFFICLIGHTTIAITIND_HAIN_REGI0N_0N_R1_STREETPREPARE 0 »define SCVI_TRAFFICLIGHTNAITING_HAIN_REGION_OFF 8 «define SCVI TRAFFICLIGHTTIAITING HAIN REGION OFF Rl YELLOWON 8 «define SCVI_TRAFFICLICHTTIAITING_HAIN_RECI0N_0FF_R1_YELL0(WFF 0
self.exit.sequence.main.region.off() self.sci_user.brightness = 1 self.enter_sequence_main_region_on_defaultO else: did transition = False sclt.statc.vcctorlel = self. State. null_statc def cxit_scqucrcc_nain_reqlon.on(sclf): self.next.state.index 6 self.state.vectorlel - self.State.null state return didtransition def __init__(self, statemachine): self.on_button = yuyutash self.off.button = westworld self.brightness = None self.statemachine = statemachine def moin_region_on_react(setf, try_transition) did.transition = try.transition if try.transition: if (self.reactQ) == False: if self.sci.user.off.button: self .exit_sequence_inain_region_on() self.enter.sequence.main.region.off.default() elif ((self.sci.user.on.button) and ((self.sci.user.brightness) < 10)) self.exit_sequence_main_region_on() self.sci.user.brightness = self.sci.user.brightness ♦ 1 self.enter_sequence_main_region_on_default() else: didtransition = False «ifndef SC.TYPES.H. «define SC.TYPES.H. «ifdef ..cplusplus extern "C" «endif «include <stdint.h> «include <stdbool.h> return did.transition «define sc.string char* typedef bool sc.boolean; typedef int_fastl6_tsc_short; typedef uint.fastlô.t sc.ushort typedef int32_t sc.integer; typedef uint32_t sc.uinteger; def run.cycle(self): Starts a cycle in the state machine if self.initialized is not True: raise ValueError( •The state machine needs to be initialized first by calling tha inlt() function.*) self.next.state.index = 0 while self.next.state.index < len(self.state.vector): if self.state_vector[self.next.state.index].name == ’main.region.off* : self.nain.region.off.react(True) elif self.state.vector(self.next.state.index].name =* •main.region.on* : self.aain.region.on.react(True) self.next.state.index ♦= 1 typedef double sc.real typedef void* sc.eventid typedef intptr.t sc.intptr.t «ifdef ..cplusplus «endif self..clear.events() «ifndef null «ifdef ..cplusplus «define null 0 «else «define null ((void *)0) «endif «endif SCTVtftSIOl (String): the current version of YAX1N0U Statechart Tools, for ex« TIMESTAMP (String): the current date and tlae as a localised string, for nam USER (String): the naat of the current user aho started ttils instance of yakii HOSTNAME (String): the host noms of the aechine on ehich YAKINOU Statochart T< SHA25-S (String): The hash of the referenced file (for exaople, the state chart SCIFIU (String): rath to the stateefurt file relative to the woranpaca. «define bool.true true «define bool.false false «endif /* SC.TYPES.H. */ ■К *>t h. (о*. poth. ]• U (o*. Mth. Лгав Ai) * f«ter CMttca init code here.. GeneratorHodel for yakindu:: java { var projectName : string = "light_switch" var version : string = "1.0" var isBeta : boolean = true var generateTimerService : boolean = true statechart myStateAutomaton { feature Outlet { targetProject = projectName targetFolder = "sre-gen/" ♦ version ♦ (isBeta ? "beta librarylargetFolder = "sre" sc boolean traf f lei 19h tWaltingjMin_reglon_on_rl_PcdNaltlng.tcv8_ralsed; sc.boolean traf fId.i9btd3itin9_dain.rc9ion_on_rl_l»c(jdait 1n9_rl.Ba1tOn.tcv8.raised; sc boolean traffici.lghtllaltlng_iialn_reglon_on_rl.Ped*altlng_rl_ealt0ff_tev8_relsed, sc boolean traff let lghtWal ting «aIn region on rl. StrcctAttcntlon tcv8 raised; sc.boolean traf fid igntila it lng.dain.reglon.on.rl.St reetRed.t ev8_raised; sc.boolean traffld lQhtHaiting_«aln.reglon.on_rl_PedestrianGrcen_tev8_raised; sc.boolean tratf lcti9htiialting.«ain_rcglon.on_rl.Pcdcstrian«cd_tcv6_rols€d; sc.boolean traffletightiiamng_«ain_region_on_rl.StreetPrepare_tev«_raised; sc.boolean traff lcU9htNaiting jiain.rcgion.off _rl_YcUo*On_tcv8_raiscd; sc.boolean trafflcli9ht*alting *am region off.rl YcllcwOff tev8 raised; > TraffiellghtWaltlngTl»cEvcnts; feature GeneralFeatures { TimerService = generateTimerServce /*! Define dinenslon of the state configuration vector for orthogonal states. */ «define TRAFHCLIGHMIAlTING.itAX.ORIHOuONAL.SIATfcS 1 feature PyPackaging { CreateFiles false Author "admin" Version "0.0.1" ShortDescription "Some description' License "ftTFPL" URL "www. your* houepage. con" /*? Define aaxiiaun nwtbcr of tide events that can be active at once */ «define TRAFFIC! ICH THAI TING .MAX. ACTIVE .TIME .EVENTS 7 /*! Define indices of states in the StatcConfVector ♦/ «define SCVI_TRAFFICtICHniAITIMG.MAIN.RfCIOH.ON 8 «define SCVI.TRAFFICLIGHTlIAITING.NAINJtEGION.ON.Rl.STREETGREEN 0 «define SCVI.TRAFFICLIGHTWAITIMG MAIN REGION ON.Rl PE WAITING 0 «define SCVI TRAFFICLIGHntAITIMG.MAIN.RfGION.ON.Rl PEWAITING.R1 KAITON 8 «define SCVI.IRAI I ICLIGHIKAl Ï ING_MAIN_REGI0N_0N_R1_PED9AI I ING.Rl.HAlTOf F 8 «define SCVI.TRA1fICIIGHIKAIIIMG.MAIN.RfGION_ON.Rl.SIRt f TAIT! N1 ION 8 «define SCVI.TRAFFICtIGHTIIAITIMG.MAIN.RfGION.ON.Rl.STRfCTREO 0 riVflnw WT ТРАГГТП Tf.MIWAT T ТкГ. ИДТМ or ГЛИН ПИ PI Pf nt <;Т01ДиГ.РГГМ я ttQcuuc гсА1"итисг1СН111У111ис'м¥Ш'«с!(м ом"мгг1ьтыо о ttQCUUC 2СД1 1HVM ICriCHIMVI 1 IMC~MVIM~Bf CI(M'M'ttJ’2lbf f IVlif МИОМ в ttqcuuc гСАПШТП 1СГ ICH1ÄYI1 IHC'UYIN'bl С1(М"С1Гй1'Ы OWVI1 INC ttJ'NYI 10И в ttQCUUC 2CAI"*lHVlt ICi ICH1MYI11ИС МУ1И Ы CIQA OM bJ U OMVIl1*С~Ы NYI1СИ 8 ttQCUUG 2СД1 lHVHICf 1СНПГШ1ИС MYI* WCKM M HI bEOWYIilNC 9 ttQcuuc zcArumncriCHiMviiiHC MviiirwcKM Ow'brzibmebfnii 9 ttQcuuc 2CAI ltfVniCriCHlMYHIHC UV1M bICICM ОМ 0 \#i QC4TUC IUQTCC* 04 «JBft« TU fpC 2I9I6C©U4A6CfOL *\ ПЬГ „димгАопи рошбЬзОб-со«.. r?CGU2G .ILILbr • 2POL|0**CLjbHOu qGZCL/bjjou AGL2T0U ynjpoL .gqjiu.. CLG9|GET/6e 49/26 bAb3C|<9<3ïu0 { ttQG4IUC lBYHICflCWllVIlIHCruVX VC1IAF ”1 IMF ~F Af И12 3 \»i OGUUG vexienn ufttfpcu 04 f in gaguj« lpt1 Сви pt ecu At 94 ouct *\ ttQCHUC iBmiCfICWIMVIlIHC MVX OMIMOCOUVT 21Vlf2 I \*i DG4IUG qi*CU2|0U 04 ipt «left COU4 )дПЫ>| JOU AteiOC 40t OLJMOÔOl/*/ «49462е «\ } n.ouiciiaunwniuaiieciAbux«: ïc" poo/с vu 4b9i«icriap(Mfli(?ua MJU LCOICXÎ 04» и'Ае//«*Ю44'*СА« гс роогбви 4L9U КГ Ш^тэн JJd »DIU LOdlOU ou ь; А*Г/С*Ои'4ЬАВ*Ь91гбО: г c poo f eau iuguicridPlMOTtlua »BTUbCOiou ou^г(ь«с(ьь&Мсс~4САв ьотко: гс poo/ьви IL9U1СГ IduiВ9!IJud «га¡и \ЛЛ IOU-OU-bJ-bfcQM|b|euB*Q-4bAe-l.9 гс poofeau jlouKl idpieaiiJud mju lcOjoи ou cj ьсосг(ьтоисьсси jcaj uaueq »c“poofC9u (!.94 47CridU(B9H7Ud~nTU~boOrou~au-L7~2(bMnieq~tCA8~i.a;coq: гс poofeau ib94UcrmuiB9Ti7ud-WTu-Lcaiou ou-i.j*2ib«€iviie«lIou-iCAe'bei2ca 2С poo/cgu 4b944ICf ldU4M9fi?Ud W91U LtdfOU OU tj bGQUSJIfUd LJ «914044 X6/43 ' гс poof CSU 4L9|4 7CT7dU4«9|i JUd 1ГЗ JU LC-dJOU OU IJ |jtQ||9J4TL)d LJ~«9X40U~4tA9 Ы гс pooftuu 4L9| 4 JC| JdpiJIU 11 ix3 »JJU LtdlOU OU bJ b6Q*9J4 JUd~4tAfi'L9j^tqî 171«€ЬгвЬЛ/С6 = a6U6L9/61/U6L26LAC6 tGUinUG eCUGLO/tbOidLGZ { /7PL9LÀigLâ6fhO/q6L = ,.гисИ i3ud6ftojq6u = .гис-аби\. ♦ лвигтои ♦ (тгветэ ь .Рбтэ fgudsibLOÎGCi = ЬиоЗбс^кэие 469inuG Odi/Gi { 2f9fGCU9Lf ÜÂ2f9fGVdiOiUgfOU { лзи â6U6L9{6j.7UJ6L26uv7C6 : роо/бэи = (une леи тгвбтэ : роо/бзи = типе A9L A6L2JOU : ZfLTUÛ = „J'0„ A9L Ыл]естизше : ziLjuâ = M/iâpT_2M7icpM eGuGL9iOLMoqer 40L A9K?uqn::Тэа9 { JLAbE2~H~ *\ i9fze i9fZ6 fuie (uie «UlfT егхииа): ьчхи ю n* гх»х*< ЗНЮ9 (ïicjud) : и» 1Я»ги 04 !И> L*. НСгигАЛ (2X1.rud): IV« uo»i utm о А пав (2iwii*4): xi* 1Л* 04 хх* С1КЛ пилу», (гхиив): it« ау^алч гсшвг;за (гхи»Х): »и. елдли Ш си АУХИЮП Л « хи;* |иах»1 kxixow *11.11* lOOi1 TT ((AOTq »)B) пХ/ 0 Ь/пгЬ/пг zef±-~cfe9L GA6ufг() 20 ff ’ UGXf ZfOf. G TUCXx 4*. гб/t •u9iu-LeâT0u-ce_Le«:j e/?b гв/4-г/9/в“лв//оL[te. 26/4'OSJU~LedlOU~pff~J69l T4 26/424946_A6C40L[2l/4 «P7/6 26/4 ’ U6x/-249i6 7uq6, 26/4‘u6X4_249/e_7uq6X = ei ,1P6 2/9/6 IU9CP7U6 UGgJ U9726 A3/n6EUL0L( Ж 74 26/4•7u7TTg/7S6q ?г iM /пгЬ/пг 249/6 /uqe /и-/ 2C~7U/b/u-/ LCd70u~044 ^/s/б 7uq6xy u9W6 U(26/4’2/9/ь Л6С/ I* 2C~6A6u/7q 7ufl /p* 7U7/O 4пис/7ои*,) e ?u7/79/jseq 47ьг/ 25“/ гс"п7и/б0би: 5“/ 2C“7U/6âGL‘. '492/19“/ гс“пгро1./ 92/J9“/2C”2P0L/Î I 2C“P00/G9U‘. ... 2/зи/г 9 cAc/6 7U qe/ Lnu“cAc/6(26/4): 6/09CP7U6 L7Uâ Cp9L* L6/nuu q/q /L9U27/70 Q/q /L9U27/70U = Ь9 6/26 : i 26/ 4 ‘ 6U/6L. 2Gdn6UcJ 26/4'2C7“n26L'pu/âM 26/4 ■ 6X7/~26dn6uc6 "I 6/74 ( (26/4 * 2С7_П2611 26/4-6U/6G“26dn6UC6l 26/4'6X7/“26dn6uc6“i 74 26/4•2С7“П26Ь-044 74 (26/4 L69C/0) = = 74 /lA“/l9U27/70u: ЩL6ÔIOU“OU“qG 49П//() Щ = 26/4 "2С7~П261.‘ PL70P/U622 ♦ J Wi.6â70u“ou() R)n//ou) guq ((26/4"207”пгви'pi>7dp/U622) < J0)) ru“L607Ou“O44“qe49n//() Ü U6Û7OU ou() //ou: 26: tqG47UG гс"1лЛг"н 74uq64 гС‘1АЬ12_Н гв/^'г/э^бшзсртиб = г/э^вшэертиб гб/4;*рит0рх1/ргг = цоиб 2G/4;*04:4:“pnf(:0U = MG2/M0L/Q 2GX4;-ou“pn/|;ôu = ЛпЛп/эгр qet tutî (гб/4-‘ г/э^вшэертиб) : qjq"^L9U2jou = q©4 U9JU“L6070U"0U“U69C игjou геft% lьА“^L9uaTi70U) LGJOLU qjq JL9U?JlTOU qjq îL9ü2Tî70u = ьэ/ге е/гв: 2©i"veuceL"26dn6uce“w9ju“L6ô70u“ou"qe^9nri() 26/4 * 2CJ "*П26Ь ’ pLjâpjlJG32 = J 2Grie6XIl”2GdnGUCG”lU9IU”L6âl0U”011.n «CJ4e«4946-ACCiOLl8j - «6J4e2l9X6unXJ-«igxC «CJ4eUGXÎ «X9XC JUQCX r fi qci txjr’rtdntuct~«Qiu'Ltdiou’ou(«t/4): *6/4*«49ХС“АЬС(ОЦ8) «Gj4-2l9fGunjr«ieiG
Westworld,Сериалы,Dolores Abernathy,ADAM MOHAREVSKI
Еще на тему