Presentation is loading. Please wait.

Presentation is loading. Please wait.

Adding Time-Step Management to Distributed Ptolemy-HLAcerti framework Yanxuan LI, Janette Cardoso, Pierre Siron 11th Biennial Ptolemy Miniconference Berkeley,

Similar presentations


Presentation on theme: "Adding Time-Step Management to Distributed Ptolemy-HLAcerti framework Yanxuan LI, Janette Cardoso, Pierre Siron 11th Biennial Ptolemy Miniconference Berkeley,"— Presentation transcript:

1 Adding Time-Step Management to Distributed Ptolemy-HLAcerti framework Yanxuan LI, Janette Cardoso, Pierre Siron 11th Biennial Ptolemy Miniconference Berkeley, October 16, 2015 1

2 Plan Introduction High Level Architecture (HLA-CERTI) PTII-HLA Framework Example Producer/consumer (NER, TAR) Conclusion & Perspectives 2

3 3 Distributed Simulation System itself is distributed WHY ? System is too complex and/or too much models – Reduce the simulation time – Enable larger simulations – Integrate several (different) simulators into a single simulation environment. Physical System

4 4 Cyber-Physical System HMI Control Propeller Engine Computer Science Control Physics ≠ disciplines Cyber Flight dynamics Flight Dynamics IMU Ultrason Sensors WP Heterogeneous models Distributed simulation HLA

5 5 HLA High Level Architecture High Level Architecture for distributed discrete event simulations IEEE standard (1516) Interoperability and reuse FOM Federation Object Model (Object: Class, Attribute) Federate = Simulator Federation = Distributed simulation

6 6

7 7 HLA Time Management. Time Advancing mechanisms: the federation will be conservative, deterministic and repeatable. The federates can be: – Time-Stepped (TAR) – Event-Driven (NER) Federate RTI timeAdvanceRequest (TAR) or nextEventRequest (NER) timeAdvanceGrant (TAG) UAV(object,attribute,timestamp) RAV(object,attribute,timestamp) reflectAttributeValues (RAV) updateAttributeValues ( UAV ) Federate f1 Federate f2 RTI HLA Object Management subscribeObjectClassAttribute()publishObjectClass()

8 8 HLA Time Management Federate RTI timeAdvanceRequest (TAR) or nextEventRequest (NER) timeAdvanceGrant (TAG) reflectAttributeValues (RAV) updateAttributeValues ( UAV ) Federate f1 Federate f2 RTI HLA Object Management

9 Bridges between PTII and HLA standard 9 PTIIHLA standard Model InstanceFederate Model Time: tLogical Time: Lt Data (Token)Data (Attribute of an object class instance) Event e(t, n, val)Event e(obj, val, Lt) Director advances timeRTI advances time Input & Output portsHlaPublisher + HlaSubscriber (UAV+RAV) Time Management Time advancing in Ptolemy > uses the advancing time services of HLA Interface between DE director and RTI: decorator HlaManager Object Management -> actors for translating: A ptII-event from an out-port to a UAV service: new actor HlaPublisher RAV service from RTI to a ptII-event in an in-port: new actor HlaSubscriber

10 PtII-HLA framework 10 e(t, n, val) Run-Time Infrastructure (RTI) : CERTI e(t''=f rav (g uav (Lt')) n, val) RAV(o1,val,Lt')UAV(o1,val,Lt'= g uav (f uav (t))

11 PtII-HLA framework 11 Run-Time Infrastructure (RTI) : CERTI RAV(o1,val,Lt') UAV(o1,val,Lt'= g uav (f uav (t))) Ptolemy HLA in PtII HLA t ptII t hla Lt t nextPointInTime_hla = t current_hla + T s_hla Time lines Lt current_hla

12 PtII-HLA framework 12 Receiving Sending

13 13 Events processing Run-Time Infrastructure (RTI) : CERTI CalendarQueue e 3 (t 3, n 3, val 3, Actor 3 ) preUAV 1 (t 1,n 1,val 1,HlaPub) UAV(o 1,val 1,Lt 1 = g uav (f uav (t1))) preUAV 1 (t 1, n 1, val 1 )

14 14 Events processing HLA in PtII pUAV 1 (f uav (t 1 )), val 1 ) Run-Time Infrastructure (RTI) : CERTI UAV(o 1,val 1,Lt 1 = g uav (f uav (t1))) CalendarQueue e 3 (t 3, n 3, val 3, Actor 3 ) preUAV 1 (t 1,n 1,val 1,HlaPub) t1t1 t 2’ t3t3 preUAV 1 pUAV 1 pRAV 2’ folRAV 2’ e3e3 f uav : t preUAV -> t uav NER : f uav (t) = t + lah TAR : t current_hla +lah, if t < t current_hla + lah t, otherwise f uav (t) = preUAV 1 (t 1, n 1, val 1 )

15 15 Events processing Run-Time Infrastructure (RTI) : CERTI RAV(o 1,val 1,Lt 1 ) UAV(o 1,val 1,Lt 1 = g uav (f uav (t 1 ))) CalendarQueue HLA in PtII pRAV 1 (f uav (t 1 ), val 1 ) preUAV 1 (t 1, n 1, val 1 )

16 16 Events processing HLA in PtII Run-Time Infrastructure (RTI) : CERTI folRAV 1 (t 1’’ =f rav (f uav (t 1 )),n 1, val 1 ) RAV(o 1,val 1,Lt 1 ) UAV(o 1,val 1,Lt 1 = g uav (f uav (t 1 ))) pRAV 1 (t 1’ =f uav (t 1 ), val 1 ) f rav (f uav (t 1 )) pRAV 1 folRAV 1 CalendarQueue folRAV 1 (f rav (t 1’ ),n 1,val 1,HlaSub) f rav : t rav -> t folRAV NER : f rav (t) = t TAR : f rav (t) = t nextPinTime_hla, if t ∈ ]t current_hla t nextPInTime_hla ] t if t> t nextPointInTime_hla preUAV 1 (t 1, n 1, val 1 ) f uav (t 1 )

17 17 Data Management with timestamps Time "synchronization" – A local PtII event is safely computed if no (external) HLA events can arrive with a smaller timestamp – A PtII federate declares its time advancement proposal to the federation through proposeTime ()

18 Distributed Producer/Consumer 18 e 1 (9, 1, 1.0), e 2 (15, 1, 2.0) e 3 (19, 1, 3.0), e 4 (39, 1, 4.0) TAR f uav (t) = t f rav (t) = t nextPinTime_hla NER f uav (t) = t + lah f rav (t) = t

19 19 Conclusion An easy way to produce a HLA federate from a Ptolemy model A way to distribute the execution of a Ptolemy model + hardware-in-the-loop Time management extend for time-stepped federates (TAR mechanism) On-going work, started with G. Lasnier, J. Cardoso, P. Siron, C. Pagetti and P.Derler. Distributed simulation of heterogeneous and real-time systems. In DS-RT13. Perspectives Compare TAR and NER performance and define related applications Implement TARA and NERA mechanisms: TAR and NER with lookahead = 0. Make a more complex application: multi-periodic flight controller ROSACE (Research Open-Source Avionics and Control Engineering).

20 20 Thank you for your attention.

21 Distributed Simulation 21 e 1 (9, 1, 1.0), e 2 (15, 1, 2.0), e 3 (19, 1, 3.0), e 4 (39, 1, 4.0) preUAV 1 pUAV 1 pRAV 1 folRAV 1 Events List e 1 (10, 1, 0.5)Events List Ts = 10, lah= 0.1, TAR

22 e 1 (10, 1, 0.5), e 2 (20, 1, 1.0), e 3 (20, 2, 1.5)e 1 (10, 1, 0.5) Distributed Simulation 22 e 1 (9, 1, 1.0), e 2 (15, 1, 2.0), e 3 (19, 1, 3.0), e 4 (39, 1, 4.0) preUAV 1 pUAV 1 pRAV 1 folRAV 1 preUAV 2 pUAV 2 preUAV 3 pUAV 3 pRAV 2 pRAV 3 folRAV 2 folRAV 3 Events List Ts = 10, lah= 0.1, TAR

23 Distributed Simulation 23 e 1 (9, 1, 1.0), e 2 (15, 1, 2.0), e 3 (19, 1, 3.0), e 4 (39, 1, 4.0) preUAV 1 pUAV 1 pRAV 1 folRAV 1 preUAV 2 pUAV 2 preUAV 3 pUAV 3 pRAV 2 pRAV 3 preUAV 4 folRAV 2 folRAV 3 pUAV 4 pRAV 4 folRAV 3 Events List e 1 (10, 1, 0.5), e 2 (20, 1, 1.0), e 3 (20, 2, 1.5), e 4 (40, 1, 2.0)Events List Ts = 10, lah= 0.1, TAR e 1 (10, 1, 0.5), e 2 (20, 1, 1.0), e 3 (20, 2, 1.5)

24 Conclusion 24 Algorithms of time management AlgorithmsHLAHLA/C ERTI PTII/ HLA OptimisticJefferson 85XNon Conservative 1 st generation Chandy, Misra & Bryan 79 (lookahead > 0) XXX Conservative 2 nd generation State global computation, Mattern XNonOther RTI? Null Prime Message protocolXXX

25 HLA-CERTI 25 Superdense time? – In accordance with the HLA standard, time representation could be PtII superdense time A requirement ? Requires very high C++ skills – Sometimes, events with the same HLA timestamp are transformed in events with different PtII timestamps – Actor's ranking Lost in the distribution Problems for an automatic distribution of PtII (work in progress)

26 26 Reference 1.R. M. Fujimoto. Time Management in the high level architecture 2.G. Lasnier, J. Cardoso, P. Siron, C. Pagetti and P.Derler. Distributed simulation of heterogeneous and real-time systems. In DS-RT13 3.U. of Berkeley. The ptolemy project. http://ptolemy.eecs.berkeley.edu/ptolemyII/index.htmhttp://ptolemy.eecs.berkeley.edu/ptolemyII/index.htm 4.ONERA. Certi. http://www.nongnu.org/certi/certi_doc/Install/html/intro.htmlhttp://www.nongnu.org/certi/certi_doc/Install/html/intro.html 5.D. Come. Improving hla-ptolemy co-simulation framework. 6.Y. LI. A Distributed Simulation Environment for Cyber-physical systems.

27 27 HLA Time Management Distributed Events Ordering Time Management. Time Advancing mechanisms The federation will be conservative, deterministic and repeatable. The federates can be: – Time-Stepped (TAR) – Event-Driven (NER) Federate RTI timeAdvanceRequest (TAR) or nextEventRequest (NER) timeAdvanceGrant (TAG) reflectAttributeValues (RAV) updateAttributeValues ( UAV ) Federate f1 Federate f2 RTI HLA Object Management UAV(object,attribute,timestamp) RAV(object,attribute,timestamp)

28 28 Data & Time Management Time "synchronization" – A local PtII event is safely computed if no (external) HLA events can arrive with a smaller timestamp – A PtII federate declares its time advancement proposal to the federation through proposeTime ()


Download ppt "Adding Time-Step Management to Distributed Ptolemy-HLAcerti framework Yanxuan LI, Janette Cardoso, Pierre Siron 11th Biennial Ptolemy Miniconference Berkeley,"

Similar presentations


Ads by Google