A Model Transformation Approach for the Development of HLA-based Distributed Simulation Systems
1. A Model Transformation Approach for
the Development of HLA-based
Distributed Simulation Systems
1st International Conference on Simulation and Modelling Methodologies,
Technologies, and Applications (Simultech), July, 2011
Andrea D'Ambrogio, Giuseppe Iazeolla, Alessandra Pieroni
University of Rome TorVergata
dambro@uniroma2.it
Daniele Gianni
European Space Agency
daniele.gianni@esa.int
2. 2
Distributed Simulation and HLA
Simulation partitioned on two or more processors
connected by a communication network
Some benefits
• Geographical distribution
• Increased performance (speed-up, fault tolerance, etc.)
• Enhanced reusability of HW and SW resources
Distributed simulators are more complex than local
ones (inherent parallelism, synchronization, etc.)
HLA is a IEEE standard (4 docs) aiming to increase DS
simulation SW reusability and interoperability
3. 3
HLA Main Components
Federate: a remotely-
accessible simulation sub-
system
Federation: the overall DS
system, composed of a set
of Federates
RTI: provides
communication and
coordination services to the
Federates that join into a
Federation
Data exchange: HLA Object
for persistent entities, HLA
Interactions for temporary
entities
Federate
RTI Ambassador
Federate Ambassador
Runtime Infrastructure (RTI)
5. 5
Motivation
HLA is technically complex and involves:
Acquiring knowledge of HLA concepts (steep learning
curve)
Making design choices, which can in turn affect the
simulation model
Developing federates, either from scratch or by
reusing already available federates
There is room for:
Reducing development effort and time
Better support for managing increasingly complex
software
Enhancing the reuse of software products
6. 6
Problem Statement
How can we improve the development of
HLA-based distributed simulation systems?
By applying a Model-driven engineering
(MDE) approach that automates the
production of a HLA simulators from a UML
model of the system to be simulated
By using standards methodologies (e.g. MDA)
and technologies for general-purpose SW
7. 7
MDA development lifecycle
source: OMG’s MDA Guide v1.0.1
Platform
Independent
Model
Platform
Specific
Model
This paper contributionExample Application
UML
HLA UML Profile
8. 8
Quick notes on UML constructs
Actor-Boundary Class: interface with the outside
world
Control Class: execution flow in a use case
Entity Class: persistent data exchanged between
actors
Associated Entity Class: aggregation of entity
classes
Actor-Boundary Messages: temporary data
Boundary-Control messages: temporary data
10. 10
PIM-PSM Transformation Rules
Rule 1 “Actor-Boundary to Federate”
• Federate: the smallest independent unit (by definition)
Rule 2 “Control to Federate”
• Use case flow federate implementing the respective flow
Rule 3 “Entity to Object Class”
• HLA Object (by definition)
Rule 4 “Associated Entities to Federate”
• Federate: group of entities encapsulating behaviour
Rule 5 “Actor-Boundary Messages to Self-Messages”
• Sequence interactions between federates
Rule 6 “Boundary-Control messages to RTI messages”
• Sequence interactions between federate and RTI
11. 11
PSM-Code Transformation Rules
Rule 1 “PSM Federate to Java Federate and Federate
Ambassador Classes”
Rule 2 “PSM Object Class to FOM Object Class*”
*(HLA persistent –and shared– data in a HLA federation)
Rule 3 “PSM Interaction Class to FOM Interaction Class*”
*(HLA temporary data exchanged in a HLA federation)
17. 17
Conclusions
HLA presents several shortcomings (specialised know-
how, development effort, limited reusability, etc.)
A model-driven approach can contribute to overcome
these shortcomings by raising the design from a
programming to a model level
We have implemented a MDA-based approach for the
automatic derivation of HLA simulators
• UML profile for HLA
• PIM to PSM QVT transformation
• PSM to Java Code QVT transformation
We have shown an example application to the
derivation of a HLA simulator for a Phone SIM card
system
18. 18
We would like to thank Simone Loprieno and Giacomo
Tiberia for the transformation implementation and
example validation.
Acknowledgements
20. 20
Applying MDA to HLA
Definition of UML profile for HLA (HLA UML)
Definition of PIM to PSM transformation,
using QVT
• relationships between UML concepts with HLA
UML concepts
Definition of PSM to code transformation,
using QVT
• relationships between HLA UML concepts and
Java coding for the HLA simulator
21. 21
Model-Driven Architecture
The OMG (Object Management Group) addresses MDE with
MDA, the Model Driven Architecture
MDA Motivation: transfer the focus of work from coding
(“everything is an object”) to modeling (“everything is a
model”)
MDA provides a set of guidelines for structuring specifications
expressed as models and the transformations between such
models
The transformations map the elements of a source model that
conforms to a specific metamodel to the elements of another
model, the target model, that conforms to the same or to a
different metamodel
24. 24
Associated standards
Model definition
UML Profiles: language for the specialization of UML
metamodel.
Meta Object Facility (MOF): language for the definition of
metamodels
XML Metadata Interchange (XMI): XML coding format for
MOF metamodels
Model transformation
MOF 2.0 Query/View/Transformation (QVT): a standard
language for specifying transformations.
26. 26
Rule 3 Graphical Representation
name = n
«Entity»
self : Class
Entity to ObjectClass
destination : UMLsource : UML
C E
name = n
«ObjectClass»
result : Class
self.isStereotypeApplied(self.getAppliedStereotype(“MVC::Entity”)
when
27. 27
Rule 1 Textual Representation
«DEFINE javaClass FOR Federate»
package nome_federato */
«FILE './'+name+'/'+name+".java"»
package «name»;
import hla.rti1516.RTIambassador;
public class «name» {
private «"HLA1516FederateAmbassador"+name» fedamb;
private RTIambassador rtiamb;
public void log(String s){
System.out.println("«name» "+s);}
«FOREACH features AS f»
private «f.type.name» «f.name»;
public void «f.setter()»(«f.type.name» «f.name»){
this.«f.name» = «f.name»;}
public «f.type.name» «f.getter()»(){
return «f.name»;}
«ENDFOREACH»
public void run(){}
}
«ENDFILE»