1(globalThis.webpackChunkdocusaurus_classic_typescript=globalThis.webpackChunkdocusaurus_classic_typescript||[]).push([[18071],{1403(e,t,n){var r={"./c/src/Alignment.lf":[6502,[6502]],"./c/src/Asynchronous.lf":[62569,[62569]],"./c/src/BankIndex.lf":[75213,[75213]],"./c/src/CheckDeadline.lf":[69883,[69883]],"./c/src/ChildBank.lf":[96471,[96471]],"./c/src/ChildParentBank.lf":[54167,[54167]],"./c/src/ChildParentBank2.lf":[14823,[14823]],"./c/src/Contained.lf":[78882,[78882]],"./c/src/Count.lf":[16860,[16860]],"./c/src/Cycle.lf":[80937,[80937]],"./c/src/CycleReordered.lf":[20309,[20309]],"./c/src/CycleWithDelay.lf":[86136,[86136]],"./c/src/Deadline.lf":[80397,[80397]],"./c/src/DeadlineTest.lf":[95205,[95205]],"./c/src/Decentralized.lf":[68229,[68229]],"./c/src/DecentralizedFeeback.lf":[98244,[98244]],"./c/src/DecentralizedFeebackSTA.lf":[5646,[5646]],"./c/src/DecentralizedFeebackSplit.lf":[16228,[16228]],"./c/src/DecentralizedFeebackWithAfter.lf":[37726,[37726]],"./c/src/DecentralizedTimer.lf":[87178,[87178]],"./c/src/DecentralizedTimerAfter.lf":[26040,[26040]],"./c/src/DecentralizedTimerHandler.lf":[31546,[31546]],"./c/src/DecentralizedTimerSTA.lf":[39220,[39220]],"./c/src/DecentralizedTimerSTPDeadline.lf":[78507,[78507]],"./c/src/DecentralizedTimerSTPHandler.lf":[34585,[34585]],"./c/src/DecentralizedZeroDelayLoop.lf":[89240,[89240]],"./c/src/DecentralizedZeroDelayLoopWithChecker.lf":[14391,[14391]],"./c/src/Destination.lf":[60167,[60167]],"./c/src/Double.lf":[96280,[96280]],"./c/src/Extends.lf":[60678,[60678]],"./c/src/Federated.lf":[17395,[17395]],"./c/src/FederatedFeeback.lf":[14438,[14438]],"./c/src/GenericDelay.lf":[59981,[59981]],"./c/src/GenericString.lf":[11187,[11187]],"./c/src/HelloWorld.lf":[48353,[48353]],"./c/src/Hierarchy.lf":[58720,[58720]],"./c/src/Interleaved.lf":[48888,[48888]],"./c/src/MainReactor.lf":[97654,[97654]],"./c/src/Methods.lf":[40969,[40969]],"./c/src/Microsteps.lf":[19542,[19542]],"./c/src/Multiport.lf":[62189,[62189]],"./c/src/MultiportSource.lf":[62888,[62888]],"./c/src/MultiportToBank.lf":[84914,[84914]],"./c/src/Overwriting.lf":[14589,[14589]],"./c/src/Physical.lf":[86448,[86448]],"./c/src/RegressionTest.lf":[42180,[42180]],"./c/src/Scale.lf":[521,[521]],"./c/src/Schedule.lf":[48628,[48628]],"./c/src/Simultaneous.lf":[77124,[77124]],"./c/src/SlowingClock.lf":[8198,[8198]],"./c/src/Sparse.lf":[22981,[22981]],"./c/src/TestCount.lf":[30884,[30884]],"./c/src/TimeElapsed.lf":[41572,[41572]],"./c/src/TimeLag.lf":[22276,[22276]],"./c/src/Timer.lf":[81682,[81682]],"./c/src/TransientFederates.lf":[52754,[52754]],"./c/src/Triggering.lf":[99661,[99661]],"./c/src/lib/Cos.lf":[8760,[8760]],"./c/src/test/AlignmentTest.lf":[83023,[83023]],"./c/src/test/ContainedOverwriting.lf":[49339,[49339]],"./c/src/test/CountDoubleDestination.lf":[75120,[75120]],"./c/src/test/CountScale.lf":[68977,[68977]],"./c/src/test/ExtendsTest.lf":[67519,[67519]],"./c/src/test/HierarchyTest.lf":[61849,[61849]],"./c/src/test/MultiportSourceTest.lf":[34141,[34141]],"./c/src/test/PhysicalTest.lf":[15783,[15783]],"./c/src/test/PreambleTest1.lf":[61102,[38721]],"./c/src/test/PreambleTest2.lf":[1872,[1872]],"./c/src/test/PreambleTest3.lf":[96971,[96971]],"./c/src/test/PreambleTest4.lf":[56898,[56898]],"./c/src/test/PreambleTest5.lf":[98077,[98077]],"./c/src/test/PreambleTest6.lf":[75820,[75820]],"./c/src/test/PreambleTest7.lf":[89063,[89063]],"./c/src/test/ScheduleTest.lf":[17183,[17183]],"./c/src/test/SlowingClockTest.lf":[31761,[31761]],"./c/src/test/SparseTest.lf":[28210,[28210]],"./c/src/test/StructParameter.lf":[34394,[34394]],"./cpp/src/Alignment.lf":[98302,[98302]],"./cpp/src/Asynchronous.lf":[59969,[59969]],"./cpp/src/ChildBank.lf":[21967,[21967]],"./cpp/src/ChildParentBank.lf":[70143,[70143]],"./cpp/src/ChildParentBank2.lf":[1439,[1439]],"./cpp/src/Contained.lf":[458,[458]],"./cpp/src/Count.lf":[45060,[45060]],"./cpp/src/Cycle.lf":[11569,[11569]],"./cpp/src/CycleReordered.lf":[30173,[30173]],"./cpp/src/CycleWithDelay.lf":[39184,[39184]],"./cpp/src/Deadline.lf":[82901,[82901]],"./cpp/src/DeadlineTest.lf":[75149,[75149]],"./cpp/src/Destination.lf":[60799,[60799]],"./cpp/src/Double.lf":[21936,[21936]],"./cpp/src/GenericDelay.lf":[72421,[72421]],"./cpp/src/GenericString.lf":[95163,[95163]],"./cpp/src/HelloWorld.lf":[24889,[24889]],"./cpp/src/Hierarchy.lf":[50088,[50088]],"./cpp/src/Interleaved.lf":[2224,[2224]],"./cpp/src/Methods.lf":[15041,[15041]],"./cpp/src/Microsteps.lf":[22718,[22718]],"./cpp/src/Multiport.lf":[16917,[16917]],"./cpp/src/MultiportSource.lf":[14112,[14112]],"./cpp/src/MultiportToBank.lf":[22602,[22602]],"./cpp/src/Overwriting.lf":[47333,[47333]],"./cpp/src/Physical.lf":[84200,[84200]],"./cpp/src/RegressionTest.lf":[73964,[73964]],"./cpp/src/Scale.lf":[12257,[12257]],"./cpp/src/Schedule.lf":[33900,[33900]],"./cpp/src/Simultaneous.lf":[53132,[53132]],"./cpp/src/SlowingClock.lf":[22510,[22510]],"./cpp/src/TestCount.lf":[59583,[81964]],"./cpp/src/TimeElapsed.lf":[91612,[91612]],"./cpp/src/TimeLag.lf":[74844,[74844]],"./cpp/src/Timer.lf":[69242,[69242]],"./cpp/src/Triggering.lf":[69077,[69077]],"./cpp/src/test/AlignmentTest.lf":[20167,[20167]],"./cpp/src/test/ContainedOverwriting.lf":[27251,[27251]],"./cpp/src/test/CountDoubleDestination.lf":[35704,[35704]],"./cpp/src/test/CountScale.lf":[51353,[51353]],"./cpp/src/test/HierarchyTest.lf":[2273,[2273]],"./cpp/src/test/MultiportSourceTest.lf":[49909,[49909]],"./cpp/src/test/PhysicalTest.lf":[51071,[51071]],"./cpp/src/test/ScheduleTest.lf":[67543,[67543]],"./cpp/src/test/SlowingClockTest.lf":[99481,[99481]],"./cpp/src/test/StructParameter.lf":[4786,[4786]],"./language_independent/Multicast.lf":[47310,[47310]],"./language_independent/PhysicalConnection.lf":[3649,[3
1649]],"./py/src/Alignment.lf":[97712,[97712]],"./py/src/Asynchronous.lf":[44291,[44291]],"./py/src/BankIndex.lf":[54091,[54091]],"./py/src/ChildBank.lf":[79237,[79237]],"./py/src/ChildParentBank.lf":[76653,[76653]],"./py/src/ChildParentBank2.lf":[82229,[82229]],"./py/src/Contained.lf":[27144,[27144]],"./py/src/Count.lf":[96326,[96326]],"./py/src/Cycle.lf":[84671,[84671]],"./py/src/CycleReordered.lf":[31479,[31479]],"./py/src/CycleWithDelay.lf":[53526,[53526]],"./py/src/Deadline.lf":[2211,[2211]],"./py/src/DeadlineTest.lf":[94615,[94615]],"./py/src/Decentralized.lf":[54635,[54635]],"./py/src/DecentralizedTimerAfter.lf":[76346,[76346]],"./py/src/DecentralizedTimerHandler.lf":[3540,[3540]],"./py/src/DecentralizedTimerSTA.lf":[81314,[81314]],"./py/src/DecentralizedZeroDelayLoop.lf":[25678,[25678]],"./py/src/DecentralizedZeroDelayLoopWithChecker.lf":[16309,[16309]],"./py/src/Destination.lf":[36813,[36813]],"./py/src/Double.lf":[98074,[98074]],"./py/src/Extends.lf":[13188,[13188]],"./py/src/Federated.lf":[14961,[14961]],"./py/src/HelloWorld.lf":[84339,[84339]],"./py/src/Hierarchy.lf":[98994,[98994]],"./py/src/Interleaved.lf":[25914,[25914]],"./py/src/Methods.lf":[87063,[87063]],"./py/src/Microsteps.lf":[87124,[87124]],"./py/src/Multiport.lf":[77691,[77691]],"./py/src/MultiportSource.lf":[22910,[22910]],"./py/src/MultiportToBank.lf":[83840,[83840]],"./py/src/Overwriting.lf":[66487,[66487]],"./py/src/Physical.lf":[72338,[72338]],"./py/src/Preamble.lf":[16931,[16931]],"./py/src/RegressionTest.lf":[71782,[71782]],"./py/src/Scale.lf":[52767,[52767]],"./py/src/Schedule.lf":[38590,[38590]],"./py/src/Simultaneous.lf":[85390,[85390]],"./py/src/SlowingClock.lf":[20092,[20092]],"./py/src/TestCount.lf":[17322,[17322]],"./py/src/TimeElapsed.lf":[6790,[6790]],"./py/src/TimeLag.lf":[59694,[59694]],"./py/src/Timer.lf":[48228,[48228]],"./py/src/TransientFederates.lf":[92456,[92456]],"./py/src/Triggering.lf":[42695,[42695]],"./py/src/test/AlignmentTest.lf":[49289,[49289]],"./py/src/test/ContainedOverwriting.lf":[47981,[47981]],"./py/src/test/CountDoubleDestination.lf":[96090,[96090]],"./py/src/test/CountScale.lf":[68051,[68051]],"./py/src/test/ExtendsTest.lf":[17133,[17133]],"./py/src/test/HierarchyTest.lf":[24923,[24923]],"./py/src/test/MultiportSourceTest.lf":[27763,[27763]],"./py/src/test/PhysicalTest.lf":[48057,[48057]],"./py/src/test/ScheduleTest.lf":[8513,[8513]],"./py/src/test/SlowingClockTest.lf":[68247,[68247]],"./py/src/test/StructParameter.lf":[52344,[52344]],"./rs/src/Alignment.lf":[99444,[99444]],"./rs/src/Asynchronous.lf":[34239,[34239]],"./rs/src/ChildBank.lf":[76633,[76633]],"./rs/src/ChildParentBank.lf":[19705,[19705]],"./rs/src/Contained.lf":[37972,[37972]],"./rs/src/Count.lf":[58354,[58354]],"./rs/src/Cycle.lf":[13803,[13803]],"./rs/src/CycleReordered.lf":[17595,[17595]],"./rs/src/CycleWithDelay.lf":[1762,[1762]],"./rs/src/Destination.lf":[3345,[3345]],"./rs/src/Double.lf":[32470,[32470]],"./rs/src/Extends.lf":[41576,[41576]],"./rs/src/HelloWorld.lf":[8295,[8295]],"./rs/src/Hierarchy.lf":[24742,[24742]],"./rs/src/Microsteps.lf":[79944,[79944]],"./rs/src/Multiport.lf":[65927,[65927]],"./rs/src/MultiportSource.lf":[75346,[75346]],"./rs/src/MultiportToBank.lf":[28964,[28964]],"./rs/src/Overwriting.lf":[45003,[45003]],"./rs/src/Physical.lf":[48958,[48958]],"./rs/src/RegressionTest.lf":[23354,[23354]],"./rs/src/Scale.lf":[63723,[63723]],"./rs/src/Schedule.lf":[1018,[1018]],"./rs/src/Simultaneous.lf":[3330,[3330]],"./rs/src/SlowingClock.lf":[27608,[27608]],"./rs/src/TestCount.lf":[30990,[30990]],"./rs/src/TimeElapsed.lf":[16874,[16874]],"./rs/src/TimeLag.lf":[77794,[77794]],"./rs/src/Timer.lf":[57928,[57928]],"./rs/src/Triggering.lf":[99291,[99291]],"./ts/src/Alignment.lf":[23146,[23146]],"./ts/src/Asynchronous.lf":[92197,[92197]],"./ts/src/ChildBank.lf":[95979,[95979]],"./ts/src/ChildParentBank.lf":[83011,[83011]],"./ts/src/ChildParentBank2.lf":[45947,[45947]],"./ts/src/Contained.lf":[75966,[75966]],"./ts/src/Count.lf":[45272,[45272]],"./ts/src/Cycle.lf":[4245,[4245]],"./ts/src/CycleReordered.lf":[28697,[28697]],"./ts/src/CycleWithDelay.lf":[88212,[88212]],"./ts/src/Deadline.lf":[26993,[26993]],"./ts/src/DeadlineTest.lf":[34257,[34257]],"./ts/src/Destination.lf":[69403,[69403]],"./ts/src/Double.lf":[95396,[95396]],"./ts/src/Extends.lf":[23402,[23402]],"./ts/src/Federated.lf":[62903,[62903]],"./ts/src/HelloWorld.lf":[40853,[40853]],"./ts/src/Hierarchy.lf":[11412,[11412]],"./ts/src/Microsteps.lf":[35802,[35802]],"./ts/src/Multiport.lf":[78329,[78329]],"./ts/src/MultiportSource.lf":[7324,[7324]],"./ts/src/MultiportToBank.lf":[36998,[36998]],"./ts/src/Overwriting.lf":[83441,[83441]],"./ts/src/Physical.lf":[63068,[63068]],"./ts/src/RegressionTest.lf":[64056,[64056]],"./ts/src/Scale.lf":[54725,[54725]],"./ts/src/Schedule.lf":[6144,[6144]],"./ts/src/Simultaneous.lf":[28104,[28104]],"./ts/src/SlowingClock.lf":[27413,[49794]],"./ts/src/TestCount.lf":[64344,[64344]],"./ts/src/TimeElapsed.lf":[10904,[10904]],"./ts/src/TimeLag.lf":[59464,[59464]],"./ts/src/Timer.lf":[22310,[22310]],"./ts/src/Triggering.lf":[32721,[32721]],"./uc/src/Alignment.lf":[64819,[64819]],"./uc/src/Asynchronous.lf":[66478,[66478]],"./uc/src/BankIndex.lf":[52668,[52668]],"./uc/src/CheckDeadline.lf":[49158,[49158]],"./uc/src/ChildBank.lf":[51778,[51778]],"./uc/src/ChildParentBank.lf":[93794,[93794]],"./uc/src/ChildParentBank2.lf":[65968,[65968]],"./uc/src/Contained.lf":[32643,[32643]],"./uc/src/Count.lf":[68845,[68845]],"./uc/src/Cycle.lf":[45152,[45152]],"./uc/src/CycleReordered.lf":[73674,[73674]],"./uc/src/CycleWithDelay.lf":[55687,[55687]],"./uc/src/Deadline.lf":[23894,[23894]],"./uc/src/DeadlineTest.lf":[78486,[78486]],"./uc/src/Decentralized.lf":[72060,[72060]],"./uc/src/DecentralizedFeeback.lf":[44764,[22383]],"./uc/src/DecentralizedFeebackSTA.lf":[84283,[84283]],"./uc/src/DecentralizedFeebackSplit.lf":[42005,[42005]],"./uc/src/DecentralizedFeebackWithAfter.lf":[2735,[2735]],"./uc/src/DecentralizedTimer.lf":[80213,[80213]],"./uc/src/DecentralizedTimerAfter.lf":[37121,[37121]],"./uc/src/DecentralizedTimerHandler.lf":[86211,[86211]],"./uc/src/DecentralizedTimerSTA.lf":[50849,[50849]],"./uc/src/DecentralizedTimerSTPDeadline.lf":[41030,[41030]],"./uc/src/DecentralizedTimerSTPHandler.lf":[86510,[86510]],"./uc/src/DecentralizedZeroDelayLoop.lf":[49823,[49823]],"./uc/src/DecentralizedZeroDelayLoopWithChecker.lf":[32690,[32690]],"./uc/src/Destination.lf":[16082,[16082]],"./uc/src/Double.lf":[67051,[67051]],"./uc/src/Extends.lf":[15411,[15411]],"./uc/src/Federated.lf":[2638,[2638]],"./uc/src/FederatedFeeback.lf":[16741,[16741]],"./uc/src/GenericDelay.lf":[68750,[68750]],"./uc/src/GenericString.lf":[31034,[31034]],"./uc/src/HelloWorld.lf":[36610,[36610]],"./uc/src/Hierarchy.lf":[37249,[37249]],"./uc/src/Interleaved.lf":[11933,[11933]],"./uc/src/MainReactor.lf":[86015,[86015]],"./uc/src/Methods.lf":[61496,[61496]],"./uc/src/Microsteps.lf":[75873,[75873]],"./uc/src/Multiport.lf":[76512,[76512]],"./uc/src/MultiportSource.lf":[84285,[84285]],"./uc/src/MultiportToBank.lf":[81667,[81667]],"./uc/src/Overwriting.lf":[91956,[91956]],"./uc/src/Physical.lf":[26987,[26987]],"./uc/src/RegressionTest.lf":[59643,[59643]],"./uc/src/Scale.lf":[66900,[66900]],"./uc/src/Schedule.lf":[14819,[14819]],"./uc/src/Simultaneous.lf":[1627,[1627]],"./uc/src/SlowingClock.lf":[61817,[61817]],"./uc/src/Sparse.lf":[26914,[26914]],"./uc/src/TestCount.lf":[34381,[34381]],"./uc/src/TimeElapsed.lf":[50149,[50149]],"./uc/src/TimeLag.lf":[53629,[53629]],"./uc/src/Timer.lf":[18423,[18423]],"./uc/src/Triggering.lf":[79482,[79482]],"./uc/src/lib/Cos.lf":[77097,[77097]],"./uc/src/test/AlignmentTest.lf":[12344,[12344]],"./uc/src/test/ContainedOverwriting.lf":[15354,[15354]],"./uc/src/test/CountDoubleDestination.lf":[46349,[46349]],"./uc/src/test/CountScale.lf":[35536,[35536]],"./uc/src/test/DestinationTest.lf":[99321,[99321]],"./uc/src/test/DoubleTest.lf":[67678,[67678]],"./uc/src/test/ExtendsTest.lf":[78628,[78628]],"./uc/src/test/HierarchyTest.lf":[13054,[13054]],"./uc/src/test/MultiportSourceTest.lf":[30562,[30562]],"./uc/src/test/PhysicalTest.lf":[92518,[92518]],"./uc/src/test/PreambleTest1.lf":[67582,[67582]],"./uc/src/test/PreambleTest2.lf":[12403,[12403]],"./uc/src/test/PreambleTest3.lf":[68760,[68760]],"./uc/src/test/PreambleTest4.lf":[16933,[16933]],"./uc/src/test/PreambleTest5.lf":[19370,[19370]],"./uc/src/test/PreambleTest6.lf":[65871,[88252]],"./uc/src/test/PreambleTest7.lf":[2996,[2996]],"./uc/src/test/ScheduleTest.lf":[48106,[48106]],"./uc/src/test/SlowingClockTest.lf":[10228,[10228]],"./uc/src/test/SparseTest.lf":[16683,[16683]],"./uc/src/test/StructParameter.lf":[8101,[8101]]};function l(e){try{if(!n.o(r,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(a){return Promise.reject(a)}var t=r[e],l=t[0];return n.e(t[1][0]).then(()=>n.t(l,17))}l.keys=()=>Object.keys(r),l.id=1403,e.exports=l},71863(e,t,n){"use strict";n.r(t),n.d(t,{assets:()=>tt,contentTitle:()=>et,default:()=>lt,frontMatter:()=>Xe,metadata:()=>r,toc:()=>nt});const r=JSON.parse('{"id":"writing-reactors/causality-loops","title":"Causality Loops","description":"Causality loops in Lingua Franca.","source":"@site/versioned_docs/version-0.9.0/writing-reactors/causality-loops.mdx","sourceDirName":"writing-reactors","slug":"/writing-reactors/causality-loops","permalink":"/docs/0.9.0/writing-reactors/causality-loops","draft":false,"unlisted":false,"editUrl":"https://github.com/lf-lang/lf-lang.github.io/tree/master/versioned_docs/version-0.9.0/writing-reactors/causality-loops.mdx","tags":[],"version":"0.9.0","frontMatter":{"title":"Causality Loops","description":"Causality loops in Lingua Franca."},"sidebar":"handbookSidebar","previous":{"title":"Methods","permalink":"/docs/0.9.0/writing-reactors/methods"},"next":{"title":"Extending Reactors","permalink":"/docs/0.9.0/writing-reactors/extending-reactors"}}');var l=n(74848),a=n(28453),c=n(76009);var s,i,o,h,f,p,d,u,y,m,g,x,b,v,E,S,k,w,T,A,z,M,C,D,H,j,P,F,B,L,G,W,O,R,V,I,_,N=n(96540);function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}const q=({title:e,titleId:t,...n})=>N.createElement("svg",U({xmlns:"http://www.w3.org/2000/svg",width:286,height:163,baseProfile:"full",viewBox:"0 0 286 163","aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,s||(s=N.createElement("desc",null,"Creator: FreeHEP Graphics2D Driver Producer: de.cau.cs.kieler.klighd.piccolo.freehep.SemanticSVGGraphics2D Revision Source: Date: Sunday, April 10, 2022 at 1:46:50 PM Pacific Daylight Time")),N.createElement("g",{strokeMiterlimit:10},i||(i=N.createElement("path",{fill:"#fff",d:"M0 0h286v163H0z"})),o||(o=N.createElement("path",{fill:"#eecbad",d:"M82 2v19a1 1 0 0 0 1 1h120a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H83a1 1 0 0 0-1 1"})),h||(h=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"M82 2v19a1 1 0 0 0 1 1h120a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H83a1 1 0 0 0-1 1z"})),N.createElement("text",{y:6,fontFamily:"Helvetica",fontSize:6,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:118,transform:"translate(84 3)"},"Reactor contains cyclic dependencies!"),f||(f=N.createElement("path",{fill:"none",stroke:"#000",d:"M84.5 12.5H142v7H84.5z"})),N.createElement("text",{y:5,fontFamily:"Helvetica",fontSize:5,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:30,transform:"translate(98.25 13)"},"Show Cycle"),p||(p=N.createElement("path",{fill:"none",stroke:"#000",d:"M145 12.5h56.5v7H145z"})),N.createElement("text",{y:5,fontFamily:"Helvetica",fontSize:5,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:29,transform:"translate(158.75 13)"},"Filter Cycle"),d||(d=N.createElement("path",{fill:"#fff",d:"M.5 41.5v113a8 8 0 0 0 8 8h269a8 8 0 0 0 8-8v-113a8 8 0 0 0-8-8H8.5a8 8 0 0 0-8 8"})),u||(u=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M.5 41.5v113a8 8 0 0 0 8 8h269a8 8 0 0 0 8-8v-113a8 8 0 0 0-8-8H8.5a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:27,transform:"translate(129.5 39)"}
1,"Cycle"),y||(y=N.createElement("path",{fill:"#f2f2f2",d:"M195.2 97.5v39a8 8 0 0 0 8 8h46.6a8 8 0 0 0 8-8v-39a8 8 0 0 0-8-8h-46.6a8 8 0 0 0-8 8"})),m||(m=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M195.2 97.5v39a8 8 0 0 0 8 8h46.6a8 8 0 0 0 8-8v-39a8 8 0 0 0-8-8h-46.6a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(223 95)"},"A"),g||(g=N.createElement("path",{fill:"#a6a6a6",d:"M204 113h39l6 11-6 11h-39l6-11z"})),x||(x=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"M204 113h39l6 11-6 11h-39l6-11z"})),b||(b=N.createElement("path",{fill:"none",stroke:"red",strokeDasharray:"6,2",strokeWidth:2,d:"M198 124h12M249 124h6"})),v||(v=N.createElement("path",{fill:"red",d:"m190 120 8 4-8 4z"})),E||(E=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"m190 120 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(184 129)"},"x"),S||(S=N.createElement("path",{fill:"red",d:"m255 120 8 4-8 4z"})),k||(k=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"m255 120 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(264 129)"},"y"),w||(w=N.createElement("path",{fill:"#f2f2f2",d:"M28.2 62.5v74a8 8 0 0 0 8 8h106.6a8 8 0 0 0 8-8v-74a8 8 0 0 0-8-8H36.2a8 8 0 0 0-8 8"})),T||(T=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M28.2 62.5v74a8 8 0 0 0 8 8h106.6a8 8 0 0 0 8-8v-74a8 8 0 0 0-8-8H36.2a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(86 60)"},"B"),A||(A=N.createElement("path",{fill:"#fff",d:"M81.5 89a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0"})),z||(z=N.createElement("path",{fill:"none",stroke:"#000",d:"M81.5 89a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0z"})),M||(M=N.createElement("path",{fill:"#a6a6a6",d:"M37 113h39l6 11-6 11H37l6-11z"})),C||(C=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"M37 113h39l6 11-6 11H37l6-11z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,fontWeight:"bold",lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(57 118)"},"1"),D||(D=N.createElement("path",{fill:"#a6a6a6",d:"M97 78h39l6 11-6 11H97l6-11z"})),H||(H=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"M97 78h39l6 11-6 11H97l6-11z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,fontWeight:"bold",lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(116 83)"},"2"),j||(j=N.createElement("path",{fill:"none",stroke:"red",strokeDasharray:"6,2",strokeWidth:2,d:"M31 124h12"})),P||(P=N.createElement("path",{fill:"none",stroke:"#000",strokeDasharray:"3,1",d:"M82 89h21"})),F||(F=N.createElement("path",{fill:"none",stroke:"red",strokeDasharray:"2,2",strokeWidth:2,d:"M76.569 114.043 100.643 100"})),B||(B=N.createElement("path",{fill:"red",d:"m92.221 101.44 4.276.979-1.253 4.203 5.399-6.622z"})),L||(L=N.createElement("path",{fill:"none",stroke:"red",strokeLinejoin:"round",strokeWidth:2,d:"m92.221 101.44 4.276.979-1.253 4.203 5.399-6.622z"})),G||(G=N.createElement("path",{fill:"none",stroke:"red",strokeDasharray:"6,2",strokeWidth:2,d:"M142 89h6"})),W||(W=N.createElement("path",{fill:"red",d:"m23 120 8 4-8 4z"})),O||(O=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"m23 120 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(17 129)"},"x"),R||(R=N.createElement("path",{fill:"red",d:"m148 85 8 4-8 4z"})),V||(V=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"m148 85 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(157 94)"},"y"),I||(I=N.createElement("path",{fill:"none",stroke:"red",strokeWidth:2,d:"M263 124h17v33H6v-33h17M156 89h17v35h17"})),_||(_=N.createElement("path",{fill:"none",stroke:"red",strokeDasharray:"2,2",strokeWidth:2,d:"M143 23v10"}))));var Z,J,$,Y,K,Q,X,ee,te,ne,re,le,ae,ce,se,ie,oe,he,fe,pe,de,ue,ye,me,ge,xe,be,ve,Ee,Se;function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(null,arguments)}const we=({title:e,titleId:t,...n})=>N.createElement("svg",ke({xmlns:"http://www.w3.org/2000/svg",width:304,height:137,baseProfile:"full",viewBox:"0 0 304 137","aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,Z||(Z=N.createElement("desc",null,"Creator: FreeHEP Graphics2D Driver Producer: de.cau.cs.kieler.klighd.piccolo.freehep.SemanticSVGGraphics2D Revision Source: Date: Sunday, April 10, 2022 at 1:54:07 PM Pacific Daylight Time")),N.createElement("g",{strokeMiterlimit:10},J||(J=N.createElement("path",{fill:"#fff",d:"M0 0h304v137H0z"})),$||($=N.createElement("path",{fill:"#fff",d:"M.5 8.5v120a8 8 0 0 0 8 8h287a8 8 0 0 0 8-8V8.5a8 8 0 0 0-8-8H8.5a8 8 0 0 0-8 8"})),Y||(Y=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M.5 8.5v120a8 8 0 0 0 8 8h287a8 8 0 0 0 8-8V8.5a8 8 0 0 0-8-8H8.5a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:76,transform:"translate(114 6)"},"CycleWithDelay"),K||(K=N.createElement("path",{fill:"#f2f2f2",d:"M213.2 29.5v39a8 8 0 0 0 8 8h46.6a8 8 0 0 0 8-8v-39a8 8 0 0 0-8-8h-46.6a8 8 0 0 0-8 8"})),Q||(Q=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M213.2 29.5v39a8 8 0 0 0 8 8h46.6a8 8 0 0 0 8-8v-39a8 8 0 0 0-8-8h-46.6a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(241 27)"},"A"),X||(X=N.createElement("path",{fill:"#a6a6a6",d:"M222 45h39l6 11-6 11h-39l6-11z"})),ee||(ee=N.createElement("path",{fill:"none",stroke:"#737373",d:"M222 45h39l6 11-6 11h-39l6-11z"})),te||(te=N.createElement("path",{fill:"none",stroke:"#000",strokeDasharray:"3,1",d:"M216 56h12M267 56h6"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(202 61)"},"x"),ne||(ne=N.createElement("path",{d:"m208 52 8 4-8 4z"})),re||(re=N.createElement("path",{fill:"none",stroke:"#000",d:"m208 52 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(282 61)"},"y"),le||(le=N.createElement("path",{d:"m273 52 8 4-8 4z"})),ae||(ae=N.createElement("path",{fill:"none",stroke:"#000",d:"m273 52 8 4-8 4z"})),ce||(ce=N.createElement("path",{fill:"#f2f2f2",d:"M28.2 29.5v74a8 8 0 0 0 8 8h106.6a8 8 0 0 0 8-8v-74a8 8 0 0 0-8-8H36.2a8 8 0 0 0-8 8"})),se||(se=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M28.2 29.5v74a8 8 0 0 0 8 8h106.6a8 8 0 0 0 8-8v-74a8 8 0 0 0-8-8H36.2a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(86 27)"},"B"),ie||(ie=N.createElement("path",{fill:"#fff",d:"M81.5 56a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0"})),oe||(oe=N.createElement("path",{fill:"none",stroke:"#000",d:"M81.5 56a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0z"})),he||(he=N.createElement("path",{fill:"#a6a6a6",d:"M37 80h39l6 11-6 11H37l6-11z"})),fe||(fe=N.createElement("path",{fill:"none",stroke:"#737373",d:"M37 80h39l6 11-6 11H37l6-11z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,fontWeight:"bold",lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(57 85)"},"1"),pe||(pe=N.createElement("path",{fill:"#a6a6a6",d:"M97 45h39l6 11-6 11H97l6-11z"})),de||(de=N.createElement("path",{fill:"none",stroke:"#737373",d:"M97 45h39l6 11-6 11H97l6-11z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,fontWeight:"bold",lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(116 50)"},"2"),ue||(ue=N.createElement("path",{fill:"none",stroke:"#000",strokeDasharray:"3,1",d:"M31 91h12M82 56h21M142 56h6"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(17 96)"},"x"),ye||(ye=N.createElement("path",{d:"m23 87 8 4-8 4z"})),me||(me=N.createElement("path",{fill:"none",stroke:"#000",d:"m23 87 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(157 61)"},"y"),ge||(ge=N.createElement("path",{d:"m148 52 8 4-8 4z"})),xe||(xe=N.createElement("path",{fill:"none",stroke:"#000",d:"m148 52 8 4-8 4zM281 56h17v68H6V91h17"})),be||(be=N.createElement("path",{fill:"#fff",d:"m175 129 4-12h10l-4 12z"})),ve||(ve=N.createElement("path",{fill:"none",stroke:"#fff",d:"m175 129 4-12h10l-4 12z"})),Ee||(Ee=N.createElement("path",{fill:"none",stroke:"#000",d:"m175 129 4-12M185 129l4-12"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:6,transform:"translate(179 118)"},"0"),Se||(Se=N.createElement("path",{fill:"none",stroke:"#000",d:"M156 56h52"}))));var Te,Ae,ze,Me,Ce,De,He,je,Pe,Fe,Be,Le,Ge,We,Oe,Re,Ve,Ie,_e,Ne,Ue,qe,Ze,Je,$e,Ye;function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ke.apply(null,arguments)}const Qe=({title:e,titleId:t,...n})=>N.createElement("svg",Ke({xmlns:"http://www.w3.org/2000/svg",width:286,height:130,baseProfile:"full",viewBox:"0 0 286 130","aria-labelledby":t},n),e?N.createElement("title",{id:t},e):null,Te||(Te=N.createElement("desc",null,"Creator: FreeHEP Graphics2D Driver Producer: de.cau.cs.kieler.klighd.piccolo.freehep.SemanticSVGGraphics2D Revision Source: Date: Sunday, April 10, 2022 at 1:59:04 PM Pacific Daylight Time")),N.createElement("g",{strokeMiterlimit:10},Ae||(Ae=N.createElement("path",{fill:"#fff",d:"M0 0h286v130H0z"})),ze||(ze=N.createElement("path",{fill:"#fff",d:"M.5 8.5v113a8 8 0 0 0 8 8h269a8 8 0 0 0 8-8V8.5a8 8 0 0 0-8-8H8.5a8 8 0 0 0-8 8"})),Me||(Me=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M.5 8.5v113a8 8 0 0 0 8 8h269a8 8 0 0 0 8-8V8.5a8 8 0 0 0-8-8H8.5a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:77,transform:"translate(104.5 6)"},"CycleReordered"),Ce||(Ce=N.createElement("path",{fill:"#f2f2f2",d:"M195.2 64.5v39a8 8 0 0 0 8 8h46.6a8 8 0 0 0 8-8v-39a8 8 0 0 0-8-8h-46.6a8 8 0 0 0-8 8"})),De||(De=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M195.2 64.5v39a8 8 0 0 0 8 8h46.6a8 8 0 0 0 8-8v-39a8 8 0 0 0-8-8h-46.6a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(223 62)"},"A"),He||(He=N.createElement("path",{fill:"#a6a6a6",d:"M204 80h39l6 11-6 11h-39l6-11z"})),je||(je=N.createElement("path",{fill:"none",stroke:"#737373",d:"M204 80h39l6 11-6 11h-39l6-11z"})),Pe||(Pe=N.createElement("path",{fill:"none",stroke:"#000",strokeDasharray:"3,1",d:"M198 91h12M249 91h6"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(184 96)"},"x"),Fe||(Fe=N.createElement("path",{d:"m190 87 8 4-8 4z"})),Be||(Be=N.createElement("path",{fill:"none",stroke:"#000",d:"m190 87 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(264 96)"},"y"),Le||(Le=N.createElement("path",{d:"m255 87 8 4-8 4z"})),Ge||(Ge=N.createElement("path",{fill:"none",stroke:"#000",d:"m255 87 8 4-8 4z"})),We||(We=N.createElement("path",{fill:"#f2f2f2",d:"M28.2 29.5v74a8 8 0 0 0 8 8h106.6a8 8 0 0 0 8-8v-74a8 8 0 0 0-8-8H36.2a8 8 0 0 0-8 8"})),Oe||(Oe=N.createElement("path",{fill:"none",stroke:"#bebebe",d:"M28.2 29.5v74a8 8 0 0 0 8 8h106.6a8 8 0 0 0 8-8v-74a8 8 0 0 0-8-8H36.2a8 8 0 0 0-8 8z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(86 27)"},"B"),Re||(Re=N.createElement("path",{fill:"#fff",d:"M81.5 56a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0"})),Ve||(Ve=N.createElement("path",{fill:"none",stroke:"#000",d:"M81.5 56a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0z"})),Ie||(Ie=N.createElement("path",{fill:"#a6a6a6",d:"M97 45h39l6 11-6 11H97l6-11z"})),_e||(_e=N.createElement("path",{fill:"none",stroke:"#737373",d:"M97 45h39l6 11-6 11H97l6-11z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,fontWeight:"bold",lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(117 50)"},"1"),Ne||(Ne=N.createElement("path",{fill:"#a6a6a6",d:"M37 80h39l6 11-6 11H37l6-11z"})),Ue||(Ue=N.createElement("path",{fill:"none",stroke:"#737373",d:"M37 80h39l6 11-6 11H37l6-11z"})),N.createElement("text",{y:10,fontFamily:"Helvetica",fontSize:10,fontWeight:"bold",lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:7,transform:"translate(56 85)"},"2"),qe||(qe=N.createElement("path",{fill:"none",stroke:"#000",strokeDasharray:"3,1",d:"M31 91h12M82 56h21M142 56h6"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(17 96)"},"x"),Ze||(Ze=N.createElement("path",{d:"m23 87 8 4-8 4z"})),Je||(Je=N.createElement("path",{fill:"none",stroke:"#000",d:"m23 87 8 4-8 4z"})),N.createElement("text",{y:8,fontFamily:"Helvetica",fontSize:8,lengthAdjust:"spacingAndGlyphs",style:{whiteSpace:"pre"},textLength:5,transform:"translate(157 61)"},"y"),$e||($e=N.createElement("path",{d:"m148 52 8 4-8 4z"})),Ye||(Ye=N.createElement("path",{fill:"none",stroke:"#000",d:"m148 52 8 4-8 4zM263 91h17v33H6V91h17M156 56h17v35h17"})))),Xe={title:"Causality Loops",description:"Causality loops in Lingua Franca."},et=void 0,tt={},nt=[{value:"Cycles",id:"cycles",level:2},{value:"Cycles with Delays",id:"cycles-with-delays",level:2},{value:"Reaction Order",id:"reaction-order",level:2}];function rt(e){const t={a:"a",code:"code",h2:"h2",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.Gv,{c:!0,cpp:!0,py:!0,rs:!0,ts:!0}),"\n",(0,l.jsx)(t.h2,{id:"cycles",children:"Cycles"}),"\n",(0,l.jsx)(t.p,{children:"The interconnection pattern for a collection of reactors can form a cycle, but some care is required. Consider the following example:"}),"\n","\n",(0,l.jsx)(c.UJ,{c:"target C;\nreactor A {\n input x:int;\n output y:int;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:int;\n output y:int;\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}",cpp:"target Cpp;\nreactor A {\n input x:int;\n output y:int;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:int;\n output y:int;\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}\n",py:"target Python;\nreactor A {\n input x;\n output y;\n reaction(x) -> y {=\n # ... something here ...\n =}\n}\nreactor B {\n input x;\n output y;\n reaction(x) {=\n # ... something here ...\n =}\n reaction(startup) -> y {=\n # ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n
1b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}",rs:"target Rust;\nreactor A {\n input x:u32;\n output y:u32;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:u32;\n output y:u32;\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}\n",ts:"target TypeScript\nreactor A {\n input x:number\n output y:number\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:number\n output y:number\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A()\n b = new B()\n a.y -> b.x\n b.y -> a.x\n}\n",lf:!0}),"\n",(0,l.jsx)(t.p,{children:"This program yields the following diagram:"}),"\n","\n",(0,l.jsx)(q,{title:"Lingua Franca diagram: Cycle",role:"img",width:"400"}),"\n",(0,l.jsxs)(t.p,{children:["The diagram highlights a ",(0,l.jsx)(t.strong,{children:"causality loop"})," in the program. At each tag, in reactor ",(0,l.jsx)(t.code,{children:"B"}),", the first reaction has to execute before the second if it is enabled, a precedence indicated with the red dashed arrow. But the first can't execute until the reaction of ",(0,l.jsx)(t.code,{children:"A"})," has executed, and that reaction cannot execute until the second reaction ",(0,l.jsx)(t.code,{children:"B"})," has executed. There is no way to satisfy these requirements, so the tools refuse to generated code."]}),"\n",(0,l.jsx)(t.h2,{id:"cycles-with-delays",children:"Cycles with Delays"}),"\n",(0,l.jsxs)(t.p,{children:["One way to break the causality loop and get an executable program is to introduce a ",(0,l.jsx)(t.a,{href:"/docs/0.9.0/writing-reactors/composing-reactors#connections-with-logical-delays",children:"logical delay"})," into the loop, as shown below:"]}),"\n","\n",(0,l.jsx)(c.UJ,{c:"target C;\nreactor A {\n input x:int;\n output y:int;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:int;\n output y:int;\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x after 0;\n b.y -> a.x;\n}",cpp:"target Cpp;\nreactor A {\n input x:int;\n output y:int;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:int;\n output y:int;\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x after 0;\n b.y -> a.x;\n}\n",py:"target Python;\nreactor A {\n input x;\n output y;\n reaction(x) -> y {=\n # ... something here ...\n =}\n}\nreactor B {\n input x;\n output y;\n reaction(x) {=\n # ... something here ...\n =}\n reaction(startup) -> y {=\n # ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x after 0;\n b.y -> a.x;\n}",rs:"target Rust;\nreactor A {\n input x:u32;\n output y:u32;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:u32;\n output y:u32;\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x after 0;\n b.y -> a.x;\n}",ts:"target TypeScript\nreactor A {\n input x:number\n output y:number\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:number\n output y:number\n reaction(x) {=\n // ... something here ...\n =}\n reaction(startup) -> y {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A()\n b = new B()\n a.y -> b.x after 0\n b.y -> a.x\n}\n",lf:!0}),"\n","\n",(0,l.jsx)(we,{title:"Lingua Franca diagram: CycleWithDelay",role:"img",width:"400"}),"\n",(0,l.jsxs)(t.p,{children:["Here, we have used a delay of 0, which results in a delay of one ",(0,l.jsx)(t.a,{href:"/docs/0.9.0/writing-reactors/superdense-time",children:"microstep"}),". We could equally well have specified a positive time value."]}),"\n",(0,l.jsx)(t.h2,{id:"reaction-order",children:"Reaction Order"}),"\n",(0,l.jsx)(t.p,{children:"Frequently, a program will have such cycles, but you don't want a logical delay in the loop. To get a cycle without logical delays, the reactions need to be reordered, as shown below:"}),"\n","\n",(0,l.jsx)(c.UJ,{c:"target C;\nreactor A {\n input x:int;\n output y:int;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:int;\n output y:int;\n reaction(startup) -> y {=\n // ... something here ...\n =}\n reaction(x) {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}",cpp:"target Cpp;\nreactor A {\n input x:int;\n output y:int;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:int;\n output y:int;\n reaction(startup) -> y {=\n // ... something here ...\n =}\n reaction(x) {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}\n",py:"target Python;\nreactor A {\n input x;\n output y;\n reaction(x) -> y {=\n # ... something here ...\n =}\n}\nreactor B {\n input x;\n output y;\n reaction(startup) -> y {=\n # ... something here ...\n =}\n reaction(x) {=\n # ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}",rs:"target Rust;\nreactor A {\n input x:u32;\n output y:u32;\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:u32;\n output y:u32;\n reaction(startup) -> y {=\n // ... something here ...\n =}\n reaction(x) {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A();\n b = new B();\n a.y -> b.x;\n b.y -> a.x;\n}",ts:"target TypeScript\nreactor A {\n input x:number\n output y:number\n reaction(x) -> y {=\n // ... something here ...\n =}\n}\nreactor B {\n input x:number\n output y:number\n reaction(startup) -> y {=\n // ... something here ...\n =}\n reaction(x) {=\n // ... something here ...\n =}\n}\nmain reactor {\n a = new A()\n b = new B()\n a.y -> b.x\n b.y -> a.x\n}\n",lf:!0}),"\n","\n",(0,l.jsx)(Qe,{title:"Lingua Franca diagram: CycleReordered",role:"img",width:"400"}),"\n",(0,l.jsx)(t.p,{children:"There is no longer any causality loop."})]})}function lt(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(rt,{...e})}):rt(e)}},53285(e,t,n){"use strict";n.d(t,{C:()=>c});var r=n(8626),l=n(76009),a=n(74848);const c=()=>{const e={values:[...l.ED].map(([e,t])=>({value:e,label:t})),children:[],groupId:"target-languages"},{selectedValue:t}=(0,r.u)(e),n=l.ED.get(t)??t;return(0,a.jsx)(a.Fragment,{children:n})}},76009(e,t,n){"use strict";n.d(t,{Gv:()=>o,UJ:()=>u,lr:()=>y,Sk:()=>m,Ae:()=>E,ED:()=>x,wu:()=>v,zV:()=>g});var r=n(96540),l=n(8626);const a="hidden_PYVj";var c=n(74848),s=n(45645),i=n(23230);const o=e=>{if(Object.values(e).every(e=>
10==e))throw new class extends Error{constructor(){super("LanguageSelector is used, but no language is supplied."),this.name="IllegalArgumentError"}};const t=Object.entries(e).filter(([e,t])=>!0===t).sort(([e],[t])=>v(e,t));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{children:(0,c.jsx)(i.A,{children:"This article has examples in the following target languages:"})}),(0,c.jsx)(s.A,{groupId:"target-languages",queryString:!0,values:t.map(([e])=>({value:e,label:x.get(e)})),children:[]})]})};var h=n(7227),f=n(71021),p=n(91539);const d=e=>{const t=Object.entries(e).sort(([e],[t])=>v(e,t));return 0!==t.length&&(0,c.jsx)(s.A,{groupId:"target-languages",queryString:!0,children:t.map(([e,t])=>(0,c.jsx)(h.A,{value:e,label:x.get(e),attributes:{className:a},children:t??""},e))})},u=e=>{const t=e.lf?p.s:f.A,{lf:n,...r}=e,l={};return Object.entries(r).forEach(([e,n])=>{l[e]=(0,c.jsx)(t,{language:e,children:n})}),(0,c.jsx)(d,{...l})};const y=({children:e,...t})=>(0,c.jsx)(c.Fragment,{}),m=({children:e})=>{const t={};return r.Children.forEach(e,e=>{g.forEach(n=>{if(e.props[n]){if(null!=t[n])throw Error(`Target language ${n} included more than once`);t[n]=e.props.children}})}),(0,c.jsx)(d,{...t})};n(53285);const g=["c","uc","cpp","py","rs","ts"],x=new Map([["c","C"],["uc","micro-LF"],["cpp","C++"],["py","Python"],["rs","Rust"],["ts","TypeScript"]]),b=new Map([["c",0],["uc",50],["cpp",100],["py",200],["rs",300],["ts",400]]),v=(e,t)=>(b.get(e)??0)-(b.get(t)??0),E=({children:e,inline:t,...n})=>{const r={values:[...x].map(([e,t])=>({value:e,label:t})),children:[],groupId:"target-languages"},{selectedValue:s,selectValue:i,tabValues:o}=(0,l.u)(r),h=!0===t?"span":"div";return(0,c.jsx)(h,{className:!0===n[s]?void 0:a,children:e})}},91539(e,t,n){"use strict";n.d(t,{s:()=>i});var r=n(96540),l=n(91324),a=n(7710),c=n(31712),s=n(74848);const i=({children:e,...t})=>{const n=c.A.canUseDOM,{colorMode:i,setColorMode:o}=(0,a.G)(),[h,f]=(0,r.useState)(`<div>${e}</div>`);return(0,r.useEffect)(()=>{(async()=>{if(!n)return;const t=await(0,l.loadShiki)();f(t.codeToHtml(e,{lang:"Lingua Franca",theme:"light"===i?"material-theme-lighter":"material-theme-darker"}))})()},[i]),n?(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:h}}):(0,s.jsx)("pre",{className:"shiki",children:(0,s.jsx)("code",{children:e})})}},71021(e,t,n){"use strict";n.d(t,{A:()=>c});n(96540);var r=n(71393),l=n(91539),a=n(74848);function c(e){return(0,a.jsx)(a.Fragment,{children:e.language?.startsWith("lf")||e.className?.startsWith("language-lf")?(0,a.jsx)(l.s,{...e}):(0,a.jsx)(r.A,{...e})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.