, Modeling rules for integration in FMI co-simulation 6.1.1.1. Model Structure and behavior 6.1.1.2 Applied stereotypes 6.1.2 Adapting fUML semantics to FMI API 6.1.2.1. Instantiation and initialization 6.1.2.2 Stepwise simulation and data propagation 6.1.2.3. Termination 6.1.3. Pseudocode of the master algorithm 6.1.4. Experience on a representative example 6.1.4.1. Definition of the simulation scenario 6.1.4.2. The simulation of the co-simulation scenario 6.2. Timed models of reactive systems 6.2.1. Modeling rules for integration in FMI-based co-simulation 6.2.1.1. Model Structure and behavior 6.2.1.2. Applied stereotypes 6.2.2. Extension of fUML semantics 6.2.2.1. The DE scheduler 6.2.2.2. The fUML extension 6.2.3. Adapting fUML execution semantics to FMI API 6.2.3.1. Instantiation and initialization 6.2.3.2. Stepwise simulation and data propagation 6.2.3.3. Termination 6.2.4. Pseudocode of the master algorithm 6.2.5. Experience on a representative example 6.2.5.1. Definition of the simulation scenario 6.2.5.2. The simulation of the co-simulation scenario 6.3. Conclusion Time is a major concern when executing models for simulation purpose. The absence of time information in the system model considerably affects the simulations correctness when the goal is to verify the workflow duration of a system, or the correctness of its behavior when placed in a time-driven environment. Specifically, Integration of timed UML models in FMI-based co-simulation Outline 6.1. Timed models of transformational systems 6.1.1 the context of CPSs co-simulation, the computations are part of the system and are connected to physical components that continuously evolve in time. Their co-simulation should account for time properties of these components in order to produce correct results

, The AcceptEventActionActivation (sem) is an action activation for an AcceptEventAction (syn) The AcceptEventAction (syn) is a particular action that waits for the occurrence of an event meeting specified condition. fUML provides execution semantics for AcceptEventAction (syn) triggered by SignalEventOccurrence (syn) In the semantic model, each acceptEventActionActivation (sem) is associated to an AcceptEventActionEventAccepter (sem) This latter handles reception of signal event occurrences on the behalf of that specific accept event action activation. For this, it defines two operations match() and accept() The match() operation checks whether a given SignalEventOccurrence (syn) matches the trigger specified for a given AcceptEventAction (syn) If so, the accept() operation is responsible for forwarding the SignalEventOccurrence (syn) to the corresponding action activation which will enable control propagation to continue the execution of the following activity nodes

, A.2.2. Instantiation semantics

, The instantiation of semantic visitors is handled by two specific classes in the semantic model which are: the Locus (sem) and the ExecutionFactory (sem)

, The class Locus (sem) defines an operation instantiate() responsible for the representation of the executable syntactic elements specified in an applicative model. The operation takes a Class (syn) as parameter which can be a Type (syn) or a Behavior (syn) The result is respectively an Object (sem) or an Execution (sem) (which is a specialization of Object (sem)) . The locus is the virtual memory of fUML in which are stored all created visitors

, The instantiation of Visitors which capture execution semantics of behavioral elements is actually handled by the ExecutionFactory (sem) class. The instantiation logic is captured by the operation instantiateVisitor() of the sub-classes ExecutionFactoryL1 (sem) ExecutionFactoryL2 (sem) B. ANNEX B: FMI for co-simulation Standard Outline B.1. The FMU content B.1.1. Structure (XMl file) B.1.1.1. 'CoSimulation' element B.1.1.2. 'DefaultExperiment' element B.1.1.3

, Stepwise simulation and data propagation B.1.2.2. Termination B.2. The Master Algorithm B.2.1. Procedures calls order B.2.2. Pseudocode of the master algorithm The content of this appendix supplements information given in chapter 2 about the FMI for cosimulation standard, in particular about the content of an FMU (section B.1) as well as the master algorithm (section B.2) We focus on details we believe required for a better comprehension of this work, For a deep understanding of the standard, refer to the standard specification

, FMU content A component which implements the FMI is called Functional Mockup Unit (FMU) It consists of one zip-file with extension

X. An, describing the variables of the FMU that are exposed to the environment in which the FMU shall be used (the structure), as well as other model information, A set of C-functions to setup and run the FMUs in a co-simulation environment (the dynamics) These C-functions can either be provided in source and/or binary form. An FMU for co-simulation embeds the solver responsible for the resolution of the equations described Further data can be included in the FMU zip-file (a model icon, documentation files, maps and tables needed by the model)

, The XML-file is defined by an XML-schema file called " fmiModelDescription.xsd " . In Figure B-1, the complete XML schema definition is shown

, Especially, the ordered lists of outputs , continuous-time states and initial unknowns (the unknowns during Initialization Mode) are defined here (see Figure B-6) It allows also to optionally define the dependency of the unkowns from the knowns. For example, the I/O dependency information is expressed in the 'Outputs' element. Figure B-6 illustrates the attributes related to the 'Outputs' element together with a description of each of them

, At the end of the simulation, the master should inform the FMU that the simulation run is terminated by calling the function 'fmi2Terminate' on the FMU. After calling this function, the final values of all variables can be inquired with the 'fmi2GetXXX' functions

, The master Algorithm B.2.1. Procedures calls order

, It identifies four modes in which the FMU can be: Instantiated, Initialization mode, Slave Initialized, Terminated. For each mode, the standard defines the functions which can be called on an FMU. Figure B-14 illustrates the life cycle of the FMU as well as the supported calling sequence B.2.2 Pseudocode of a basic master algorithm, The FMI standard defines the FMU life cycle

, The FMI standard provide a pseudocode of a master algorithm in order to sketch the typical calling sequence of the functions in a co-simulation environment

B. Figure, Calling sequence of Co-Simulation C functions Figure B-13. 'fmi2Terminate' function References [1] IEEE standard for modeling and simulation (M&S) high level architecture (HLA)? framework and rules. IEEE Std 1516-2010 (Revision of IEEE Rodin: an open toolset for modelling and reasoning in event-b, International Journal on Software Tools for Technology Transfer, vol.23, issue.126, pp.1-38447, 1516.

A. Alkhodre, J. Babau, J. Schwarz-henric-andersson, E. Herzog, G. Johansson et al., Modelling of real-time constraints using sdl for embedded systems design Experience from introducing unified modeling language-systems modeling language at saab aerosystems The High Level Architecture rti as a master to the functional mock-up interface components, 2013 International Conference on Computing, Networking and Communications (ICNC), pp.189-196369, 2002.

F. Balarin, L. Lavagno, C. Passerone, A. L. Sangiovanni-vincentelli, M. Sgroi et al., Modeling and designing heterogeneous systems Advances in Petri Nets Master for cosimulation using fmi Extending the standard execution model of UML for real-time systems, Concurrency and Hardware Design 8th International Modelica Conference Distributed, Parallel and Biologically Inspired Systems -7th IFIP TC 10 Working Conference, DIPES 2010 and 3rd IFIP TC 10 International Conference. Proceedings, pp.228-273, 1998.

F. Boulanger, C. Hardebolle, C. Jacquet, and D. Marcadet, Semantic Adaptation for Models of Computation, 2011 Eleventh International Conference on Application of Concurrency to System Design, pp.153-162, 2011.
DOI : 10.1109/ACSD.2011.17

URL : https://hal.archives-ouvertes.fr/hal-00605273

E. Bousse, T. Degueule, D. Vojtisek, T. Mayerhofer, J. Deantoni et al., Execution framework of the GEMOC studio (tool demo), Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, SLE 2016, p.8, 2016.
DOI : 10.1007/s10270-013-0354-4

URL : https://hal.archives-ouvertes.fr/hal-01355391

D. Broman, C. Brooks, L. Greenberg, E. A. Lee, M. Masin et al., Determinate composition of FMUs for co-simulation, 2013 Proceedings of the International Conference on Embedded Software (EMSOFT), pp.1-2, 2013.
DOI : 10.1109/EMSOFT.2013.6658580

J. Denil, B. Meyers, P. De-meulenaere, and H. Vangheluwe, Explicit semantic adaptation of hybrid formalisms for FMI co-simulation, Proceedings of the Symposium on Theory of Modeling & Simulation: DEVS Integrative M&S Symposium, part of the 2015 Spring Simulation Multiconference, SpringSim '15, pp.99-106, 2015.

M. Emerson and J. Sztipanovits, Techniques for metamodel composition, OOPSLA 6th Workshop on Domain Specific Modeling, pp.123-139, 2006.

J. Eyer and G. , Corey, and Sandia National Laboratories. Energy Storage for the Electricity Grid: Benefits and Market Potential Assessment Guide: a Study for the DOE Energy Storage Systems Program, SAND (Series) (Albuquerque, N.M.). Sandia National Laboratories, 2010.

A. Yishai, L. Feldman, E. Greenberg, and . Palachi, Simulating rhapsody sysml blocks in hybrid models with fmi, Proceedings of the 10th International Modelica Conference, pp.43-52, 2014.

F. , Functional mock-up interface for model exchange and co-simulation, 2013.

S. Guermazi, J. Tatibouet, A. Cuccuru, E. Seidewitz, S. Dhouib et al., Executable modeling with fuml and alf in papyrus: Tooling and experiments, EXE@MoDELS, 2015.
URL : https://hal.archives-ouvertes.fr/cea-01844057

N. Halbwachs, P. Caspi, P. Raymond, and D. Pilaud, The synchronous dataflow programming language lustre, Proceedings of the IEEE, pp.1305-1320, 1991.

C. Hardebolle and F. Boulanger, Exploring multi-paradigm modeling techniques SIMULATION: Transactions of The Society for Modeling and Simulation International, pp.688-708, 2009.

D. Harel and A. Pnueli, Logics and models of concurrent systems. chapter On the Development of Reactive Systems, pp.477-498, 1985.

D. Harel, Statecharts: a visual formalism for complex systems, Science of Computer Programming, vol.8, issue.3, pp.231-274, 1987.
DOI : 10.1016/0167-6423(87)90035-9

W. Hassairi and M. Bousselmi,

. Matlab, systemc for the new co-simulation environment by jpeg algorithm, MATLAB -A Fundamental Tool for Scientific Computing and Engineering Applications, p.6, 2012.

J. Hooman, N. Mulyar, and L. Posta, Coupling simulink and UML models, 2004.

E. A. Lee, Cyber Physical Systems: Design Challenges, 2008 11th IEEE International Symposium on Object and Component-Oriented Real-Time Distributed Computing (ISORC), pp.363-369, 2008.
DOI : 10.1109/ISORC.2008.25

A. Maria, Introduction to modeling and simulation, Proceedings of the 29th conference on Winter simulation , WSC '97, pp.7-13, 1997.
DOI : 10.1145/268437.268440

R. E. Nance, History of programming languages?ii. chapter A History of Discrete Event Simulation Programming Languages, pp.369-427, 1996.

A. Seyed-hosein, I. Niaki, and . Sander, Co-simulation of embedded systems in a heterogeneous moc-based modeling framework, Industrial Embedded Systems, pp.238-247, 2011.

O. , Uml profile for marte: Modeling and analysis of real-time embedded systems, 2011.

O. , Unified modeling language (uml), http://www.omg.org/spec, 2015.

O. Query, , 2016.

O. , Semantics of a foundational subset for executable uml models(fuml), 2016.

U. Pohlmann, W. Schã¤fer, H. Reddehase, J. Röckemann, and R. Wagner, Generating Functional Mockup Units from Software Specifications, Proceedings of the 9th International MODELICA Conference, September 3-5, 2012, Munich, Germany, pp.765-774, 2012.
DOI : 10.1109/RTAS.2012.25

, System Design, Modeling, and Simulation using Ptolemy II, 2014.

R. Rajkumar, I. Lee, L. Sha, and J. Stankovic, Cyber-physical systems, Proceedings of the 47th Design Automation Conference on, DAC '10, pp.731-736, 2010.
DOI : 10.1145/1837274.1837461

V. Savicks, M. Butler, and J. Colley, Co-simulating event-b and continuous models via fmi, Proceedings of the 2014 Summer Simulation Multiconference, SummerSim '14 Society for Computer Simulation Interna- tional, pp.1-37, 2014.

T. Schierz, M. Arnold, and C. Claud, Co-simulation with communication step size control in an FMI compatible master algorithm, Proceedings of the 9th International MODELICA Conference, September 3-5, 2012, Munich, Germany, pp.205-214, 2012.
DOI : 10.1076/1387-3954(200006)6:2;1-M;FT093

J. Sztipanovits, Composition of Cyber-Physical Systems, 14th Annual IEEE International Conference and Workshops on the Engineering of Computer-Based Systems (ECBS'07), pp.3-6, 2007.
DOI : 10.1109/ECBS.2007.25

P. Langer and T. Mayerhofer, Moliz: a model execution framework for uml models, Proceedings of the 2nd International Master Class on Model-Driven Engineering: Modeling Wizards, 2012.

J. Tatibouet, A. Cuccuru, S. Gérard, and F. Terrier, Formalizing Execution Semantics of UML Profiles with fUML Models, Model-Driven Engineering Languages and Systems -17th International Conference. Proceedings, pp.133-148, 2014.
DOI : 10.1007/978-3-319-11653-2_9

URL : https://hal.archives-ouvertes.fr/cea-01847294

J. Tavella, M. Caujolle, C. Tan, G. Plessis, and M. Schumann, Toward an Hybrid Co-simulation with the FMI-CS Standard, 2016.
URL : https://hal.archives-ouvertes.fr/hal-01301183

S. Tripakis and D. Broman, Bridging the semantic gap between heterogeneous modeling formalisms and FMI, 2015 International Conference on Embedded Computer Systems: Architectures, Modeling, and Simulation (SAMOS), 2014.
DOI : 10.1109/SAMOS.2015.7363660

B. Van-acker, J. Denil, H. Vangheluwe, and P. De-meulenaere, Generation of an optimised master algorithm for fmi co-simulation, Proceedings of the Symposium on Theory of Modeling & Simulation: DEVS Integrative M&S Symposium, DEVS '15 Society for Computer Simulation International, pp.205-212

K. Wan, D. Hughes, K. L. Man, and T. Krilavioius, Composition challenges and approaches for cyber physical systems, 2010 IEEE International Conference on Networked Embedded Systems for Enterprise Applications, pp.1-7, 2010.
DOI : 10.1109/NESEA.2010.5678065

R. Wieringa, Design Methods for Reactive Systems: Yourdan, Statemate, and the UML, 2003.

, Immeuble Discovery Route de l'Orme aux Merisiers RD 128, 91190.