您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > HLA 时间管理教程2
HighLevelArchitectureModule2AdvancedTopicsCaliforniaStateUniversity,ChicoRoyCrosbieJohnZenor2/10/2020CaliforniaStateUniversity,Chico2HighLevelArchitectureModule2AdvancedTopicsTimeManagement2:TheServicesandtheInterface2/10/2020CaliforniaStateUniversity,Chico3TimeManagementintheHLA:2.TheServicesandtheInterface•Thislesson(aswellasthepreviousone)arebasedonR.M.Fujimoto’spaper“TimeManagementintheHighLevelArchitecture”,SIMULATION71:6,1998,388-4002/10/2020CaliforniaStateUniversity,Chico4KeyComponentsoftheTimeManagementServices•Atimestamporderdeliveryservice•Aprotocolforsimulationstoadvancetheirlogicaltimes2/10/2020CaliforniaStateUniversity,Chico5IncomingMessages•Therearetwotypesofincomingmessages:–Receive-order(RO)messages,and–Time-stamp-order(TSO)messages2/10/2020CaliforniaStateUniversity,Chico6Receive-OrderMessages•Areplacedinaqueuewhentheyarrive•Areimmediatelyeligiblefordeliverytothefederate•Areorderedarbitrarily•May,optionally,containatimestampvaluewhichissimplypassed,uninterpretedbytheRTI,tothedestinationfederate2/10/2020CaliforniaStateUniversity,Chico7Time-Stamp-OrderMessages•Areassignedatimestampbythegeneratingfederate•AreplacedinaqueuewithintheRTIbutarenoteligiblefordeliveryuntiltheRTIcanguaranteethat–therearenootherTSOmessageswithasmallertimestampdestinedforthatfederate–noTSOmessagesfromotherfederateswithasmallertimestampwillarrivelater2/10/2020CaliforniaStateUniversity,Chico8SimultaneousEvents•Messageswithidenticaltimestamps,referredtoassimultaneousevents,aredeliveredtothefederateinanarbitraryorder•Thereareseveraldifferentwaystoorderthesemessagesinaparticularfashionwhichoftenmightbeimportanttodo2/10/2020CaliforniaStateUniversity,Chico9OrderingSimultaneousEvents•Thefederatereceivingsimultaneouseventscanbufferandorderthemitself–Tosupportthis,theRTIprovidesameansforspecifyingwhenthefederatehasreceivedallsimultaneouseventswithagiventime-stampvalue•Federatesmayincludetie-breakingfieldsinthemessagetimestamptoordersimultaneousevents–Thisrequiresfederationspecificationoftheformatandmeaningofthetime-stampfieldandlogicaltimevaluesandduration2/10/2020CaliforniaStateUniversity,Chico10AdvancingLogicalTime•Federatesmustexplicitlyrequestthattheirlogicaltimesbeadvanced•AdvancesdonottakeplaceuntiltheRTIgrantsthemexplicitly•ThisprotocolforadvancinglogicaltimeiscentraltotheHLAtimemanagementservices2/10/2020CaliforniaStateUniversity,Chico11AThree-StepTimeManagementCycle•Thefederateinvokesatimemanagementservicetorequestthatitslogicaltimebeadvanced•TheRTIdeliverssomenumber(possiblyzero)ofmessagestothefederate•TheRTIinvokesafederate-definedprocedurecalledTimeAdvanceGranttoindicatethatthefederate’slogicaltimehasbeenadvanced2/10/2020CaliforniaStateUniversity,Chico12MechanismsforAdvanceRequests•Thetwoprincipalmechanismsforafederatetorequestitslogicaltimetobeadvancedarethefollowingservices:–TimeAdvanceRequest(TAR)whichiswellsuitedforthosefederatesthatinternallyuseatime-steppedmechanism–Next-EventRequest(NER)whichisthepreferredprimitiveforevent-drivenfederates2/10/2020CaliforniaStateUniversity,Chico13TimeAdvanceRequest(T)•ThefederateinvokesthisservicetorequestitslogicaltimetobeadvancedtoT–AllROmessagesintheRTI’sinternalqueues,andallTSOmessageswithtimestampsT,aredeliveredtothefederateafterTAR(T)hasbeeninvoked–IfnootherTSOmessageswithtimestampsTareforthcoming(orwillbegeneratedbyanotherfederatelater),theRTIcallsthefederate’sTimeAdvanceGrantprocedurewithparameterTtoindicatethatthefederate’slogicaltimehasbeenadvancedtoT2/10/2020CaliforniaStateUniversity,Chico14Next-EventRequest(T)•Anevent-drivenfederatewilltypicallyinvokethisservicewhenithascompletedallsimulationactivityatthecurrentlogicaltimeandisreadytoadvancetoanewtime•TheparameterTinNER(T)isthelogicaltimetowhichthefederatewouldliketoadvanceiftherearenoothereventsfromotherfederateswithsmallertimestamps2/10/2020CaliforniaStateUniversity,Chico15InvokingNext-EventRequest(T)•AfterthefederateFinvokesNER(T):–TheRTIdeliversallROmessagesinitsinternalqueue–IfnopresentorfutureTSOmessagehasatimestampT,theRTIinvokesthefederate’sTimeAdvanceGrantprocedureindicatingthatthefederate’slogicaltimehasbeenadvancedtoT–Otherwise,theRTIwilldeliverthenextsmallestTSOmessagedestinedforF(withtimestampT´T)andallothermessageswithtimestampT´;thentheRTIcallsTimeAdvanceGrantprocedurewithparameterT´,andthelogicaltimeofFisadvancedtoT´2/10/2020CaliforniaStateUniversity,Chico16InterfaceIssues•Theinterfaceisdesignedsothat:–TheRTIgetsalltheinformationnecessaryforefficientimplementationsofthetimemanagementprimitives–TheRTIimplementersarenotconstrainedtouseaparticularsynchronizationprotocol•OnecanviewtheinterfaceasacontractbetweenthefederateandRTIconcerningthetimestampofmessagesthefederationmightgeneratelaterintheexecution2/10/2020CaliforniaStateUniversity,Chico17TheLowerBoundonTimeStamps•ThekeytoimplementingthetimemanagementserviceswithintheRTIistocomputethelowerboundontimestamp(LBTS)foreachfederate•LBTSF,theLBTSvaluecomputedforfederateF,isalowerboundonthetimestampsofmessagesthatmaybereceivedandthataredestinedforthatfed
本文标题:HLA 时间管理教程2
链接地址:https://www.777doc.com/doc-3630579 .html