Model Transformations in Model-Based Systems

advertisement
MBSE
Model-Based
Systems Engineering
Center
Model Transformations
in Model-Based Systems Engineering
Chris Paredis
Associate Director
Model-Based Systems Engineering Center
Georgia Tech
chris.paredis@me.gatech.edu
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
1
Objective

Provide enough information about model
transformations so that you can envision where in
your organization the use of model transformations
can add value

Examples are not meant to be an exhaustive review
of the state of the art but only illustrations
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
2
Overview of Presentation

Background — Model Transformations
– What is a model transformation? — some simple examples
– Meta-modeling and Model transformations languages

Model Transformations in MBSE?
– A taxonomy of usage scenarios
– Examples and illustrations


How to get started?
Summary
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
3
What is a Model Transformation?

Model Transformation:
Any operation on a model
that produces another model

Very general:
Almost anything you “do” with a model

Our primary interest:
Automated model transformations
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
4
Example: Models Evolve Over Time
(from: A Practical Guide to SysML — Friedenthal, Moore, Steiner)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
5
Example: Models Evolve Over Time
We forgot
to drain the
residue…
(from: A Practical Guide to SysML — Friedenthal, Moore, Steiner)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
6
Example: Models Evolve Over Time
Hmm… we could make this a continuous process
(from: A Practical Guide to SysML — Friedenthal, Moore, Steiner)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
7
Model Transformations




A SysML model is a snapshot…
How are the snapshots connected to each other?
 Model Transformations
A model transformation represents knowledge…
The more sophisticated the knowledge, the more
difficult the transformation is to automate
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
8
Examples of Model Transformations
Transformation
Stage-Gate Documents
Transformation
.pdf
.html
.pptx
System
Model
Source Model
Endogenous Transformation
2012 Copyright © Chris Paredis. All Rights Reserved.
Exogenous Transformation
MBSE
9
Examples of Model Transformations
Transformation
Stage-Gate Documents
Transformation
.pdf
.html
.pptx
System
Model
Source Model
Transformation
Project Management Metrics
Simulation &
Optimization
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
10
Some History: Model-Driven Architecture
PIM
PSM
Code
PlatformIndependent
Model
CORBA
Model
CORBA
Map Platform Specific Model
to application interfaces,
code, GUI descriptors, SQL
queries, etc.
Java/EJB
Model
XML/SOAP
Model
Other
Model
Java/EJB
XML/SOAP
Other
MDA Tool
generates all or
most of the
implementation
code for
deployment
technology
selected by the
developer.
(from: MDA, by R. Soley: www.omg.org/mda/mda_files/MDA-Seminar-Soley6.ppt)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
11
Automated Transformations: A Closer Look…
Source
Modeling Language
modeled in
Target
Modeling Language
Models must
be Formal
Source Model
Target Model
Transformation
System
Model
2012 Copyright © Chris Paredis. All Rights Reserved.
modeled in
MBSE
.pdf
.html
.pptx
12
Automated
Transformations: A Closer
Look…
Source
Target
Meta-Model
defined by
Source
Modeling Language
Meta-Model
Formal Syntax
and Semantics
conforms to
modeled in
Target
Modeling Language
modeled in
Source Model
Target Model
Transformation
System
Model
2012 Copyright © Chris Paredis. All Rights Reserved.
defined by
MBSE
.pdf
.html
.pptx
13
Modeling Languages are also Modeled Formally
Part of the meta-model for UML

UML is defined by a
meta-model

This meta-model is
defined in a
meta-modeling
language:
The MOF language
(Meta-Object
Facility)
(from: A Practical Guide to SysML — Friedenthal, Moore, Steiner)
How is a meta-modeling language defined?
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
14
The OMG Meta-Model Infrastructure
conforms to
M3
Meta-meta-model
MOF
conforms to
M2
Meta-model
UML
conforms to
M1
User Model
Model
represented by
M0
2012 Copyright © Chris Paredis. All Rights Reserved.
Reality
System
MBSE
15
Model Transformation Specification
Source
Meta-model
refers to
conforms to
Source
Model
Transformation
Specification
refers to
executes
reads
Transformation
Engine
Target
Meta-model
conforms to
writes
Target
Model
(Czarnecki, K., & Hellen, S., 2006)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
16
Implementations of Model Transformation

Imperative
– Conventional programming tools
– Access models through API of modeling tools
– Java, Python, Ruby

Declarative
– Consist of multiple declarative model transformation rules
» Left-hand side = applicability pattern
» Right-hand side = model modification to apply
– Transformation engine automatically determines which
rules to apply
– ATL, QVT, Moflon, GReAT, VIATRA2,…
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
17
Generative
Model
Transformation
for Hydraulic
System

Model Transformation
rules to generate systems

Generate random system
alternatives by applying
rules in randomized order
(Example in MOFLON)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
18
Generative
Model
Transformation
for Hydraulic
System

Model Transformation
rules to generate systems

Generate random system
alternatives by applying
rules in randomized order
(Example in MOFLON)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
19
Decision Tree of Generation Process
ct [Activity] Decision Tree[
Decision Tree ]
act [Activity] Decision Tree
act [Activity]
[
Decision
Decision
TreeTree
] [
Decision Tree ]
[success]
[success]
Add Cylinder
Add Cylinder
Add
act [Activity]
Decision Tree
[ Cylinder
Decision Tree ]
[
[
f
a
i
f
l
a
u
i
r
e
l
u
r
e
[success]
]
]
[
f
a
i
l
u
r
e
]
[succe
[success]
[success]
{probability
= ".7" }
{probability = ".7" }
[success]
{probability = ".7" }
A
A
[success]
d
Add Cylinder
d
d
d
D
D
i
r
i
e
c
V
[success]
{probability = ".3" }
{probability = ".3" }
[success]
V
a
l
v
r
t
a
e
i
c
o
l
t
n
v
i
a
o
l
n
a
[
l
A
d
d
D
i
r
e
c
t
i
o
n
V
a
l
v
f
a
i
l
u
r
e
]
[failure]
l
[failure]
e
e
a
[failure]
e
{probability = ".3" }
[success]
{probability
= ".7" }
[success]
[success]
[success]
{probability
= ".7"
{probability
= ".7"
} } {probability = ".7" }
A
A
A
d
d
[success]
[success]
[success]
d
P
d
u
P
m
u
d
m
d
D
i
r
e
c
t
i
o
n
A
V
a
d
l
d
v
P
u
[success]
[failure]
[failure]
d
d
T
a
A
n
d
k
d
a
n
p
[failure]
A
T
l
m
e
{probability
= ".3"
}
{probability
= ".3"
}
{probability
= ".3"
} {probability = ".3" }
A
a
p
p
d
d
T
a
n
k
k
[success]
{probability = ".7" }
A
d
d
P
[success]
{probability = ".3" }
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
20
u
Overview of Presentation

Context — Model Transformations
– What is a model transformation? — some simple examples
– Meta-modeling and Model transformations languages

How can model transformations be useful in MBSE?
– A taxonomy of usage scenarios
– Examples and illustrations


How to get started?
Summary
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
21
Taxonomy for Model Transformations in MBSE

Organized by the nature of the knowledge encoded in
the transformation
1. Knowledge about Views
» Take information from a model and represent it in a
different (graphical) syntax
2. Knowledge about Analysis
» Take a structural description of a system and generate
a corresponding analysis model
3. Knowledge about Synthesis
» Generate a (more detailed) structural description

From simple to sophisticated
From specific to general
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
22
Why are Model Transformations Important?
Collaboratively Developing Complex Systems
Testing
Software
Analysis
Project
Management
•
•
•
•
Manufacturing
2012 Copyright © Chris Paredis. All Rights Reserved.
Fuselage
Landing Gear
Engines
…
CAD
MBSE
23
Why are Model Transformations Important?
Highly Interrelated Information & Knowledge
Testing
Software
Analysis
Relations /
Dependencies
Project
Management
•
•
•
•
Manufacturing
2012 Copyright © Chris Paredis. All Rights Reserved.
Fuselage
Landing Gear
Engines
…
CAD
MBSE
24
Why are Model Transformations Important?
MBSE Allows for More Formal Communication
Testing
Software
Analysis
System
Model
Project
Management
•
•
•
•
Manufacturing
2012 Copyright © Chris Paredis. All Rights Reserved.
Fuselage
Landing Gear
Engines
…
CAD
MBSE
25
Why are Model Transformations Important?
MBSE Allows for More Formal Communication
Testing
Software
Analysis
System
Model
Project
Management
•
•
•
•
Manufacturing
2012 Copyright © Chris Paredis. All Rights Reserved.
Fuselage
Landing Gear
Engines
…
CAD
MBSE
26
Example: Representing CAD parts
in Creo as SysML Blocks in MagicDraw
Step 2: A surrogate SysML block
element is generated with the Creo
parameters. This block represents the
Creo model for the system engineer.
Step 3: The surrogate SysML block
element (and corresponding instance)
is connected to the Creo model. System
engineer can sync parameter values.
Values read from Creo
(from: Manas Bajaj, InterCAX)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
27
Example: Representing Assembly Structures in
Windchill as SysML part properties in MagicDraw
Auto-generation and sync
SysML model
block structure
Part structure (BOM) in PLM systems
(e.g. Windchill)
(from: Manas Bajaj, InterCAX)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
28
Document Generator by INCOSE SE2 team
(mbse.gfse.de)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
29
Document Generator by INCOSE SE2 team
(mbse.gfse.de)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
30
Document Generator by INCOSE SE2 team
(mbse.gfse.de)
Transformation
DocBook XML file
XSLT
Transformation
SysML +
Profile
.html .pdf .docx
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
31
Using DocGen at JPL
(Source: “Model Based Document and Report Generation
for Systems Engineering,” Delp, Lam, Fosse, Lee)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
32
Taxonomy for Model Transformations in MBSE

Organized by the nature of the knowledge encoded in
the transformation
1. Knowledge about Views
» Take information from a model and represent it in a
different (graphical) syntax
2. Knowledge about Analysis
» Take a structural description of a system and generate
a corresponding analysis model
3. Knowledge about Synthesis
» Generate a (more detailed) structural description

From simple to sophisticated
From specific to general
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
33
Why are Model Transformations Important?
MBSE Allows for More Formal Communication
Testing
Software
Analysis
System
Model
Project
Management
•
•
•
•
Manufacturing
2012 Copyright © Chris Paredis. All Rights Reserved.
Fuselage
Landing Gear
Engines
…
CAD
MBSE
34
Execute Parametric Models in ModelCenter
Transformation
System Properties

Analysis Model
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
Syntactic
transformation from
parametrics to
ModelCenter
35
SysML-Modelica Transformation Specification
SysMLModelica
Transformation
follows the
principles
of ModelDriven
Architecture
(MDA)
36
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
36
bdd [Package] Components[
ModelOverview ]
<<ModelicaPort>>
flange_a : Flange
<<ModelicaPort>>
flange_b : Flange
<<ModelicaModel>>
ModelicaStandardLibrary::Mechanics::Translational::Interfaces::
PartialCompliant
{s_rel = flange_b.s - flange_a.s;
flange_b.f = f;
flange_a.f = -f;}
<<ModelicaValueProperty>>+s_rel : Distance
<<ModelicaValueProperty>>+f : Force
SysML4Modelica
Bi-directional
Transformation
<<ModelicaPort>>
flange_a : Flange
<
M
o
d
e
l
i
c
a
S
t
a
n
d
a
r
d
L
i
b
r
a
<
r
y
M
:
o
:
M
d
e
e
c
l
h
i
c
a
a
n
M
i
o
c
s
d
:
e
:
T
l
r
>
a
>
n
s
l
a
t
i
o
n
a
l
:
:
C
o
m
p
o
n
e
n
t
s
:
{f = c*(s_rel - s_rel0);}
<<ModelicaValueProperty>>+c : TranslationalSpringConstant{variability = parameter}
<<ModelicaValueProperty>>+s_rel0 : Distance{variability = parameter}
<<ModelicaPort>>
flange_b : Flange
<<ModelicaModel>>
ModelicaStandardLibrary::Mechanics::Translational::Interfaces::
PartialRigid
{flange_a.s = s - L/2;
flange_b.s = s + L/2;}
<<ModelicaValueProperty>>+s : Position
<<ModelicaValueProperty>>+L : Length{variability = parameter}
2012 Copyright © Chris Paredis. All Rights Reserved.
:
Spring
<<ModelicaPort>>
flange_a : Flange
Modelica
<<ModelicaPort>>
flange_b : Flange
<<ModelicaExtendsRelation>>
MBSE
37
37
SysML4Modelica to Modelica Syntactical Mapping
38
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
38
Transform Structure into Analysis Model
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
39
Transform Structure into Analysis Model

2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
Transformation
requires deep analysis
knowledge…
40
Model Transformations for Fluid Power

Transformation Rules:
– If Cylinder in descriptive, then ModelicaCylinder in
analytical
– If Pump in descriptive, then ModelicaPump and
ModelicaFilter in analytical
–…
– If connection between Pump and Valve, then
ModelicaConnection between ModelicaPump and
ModelicaValve
–…
Not a good idea!
Too many rules…
Too specific, brittle
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
41
Define Model Correspondences
Correspondence
Models
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
42
Structure to Analysis Mapping
SysML4Modelica Analysis Model
SysML Descriptive Model
Transformation
Only 2 rules
One for components
One for connections
Modelica Model
Transformation
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
43
Generation of Vehicle Analyses
(Work with students B. Bailey, J. Branscomb & Ford Motor Company)



Reference model of logical vehicle architecture in SysML
Specialize the reference model into a variant for a specific
vehicle program
Specify the types of analyses needed
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
44
Generation of Vehicle Analyses
(Work with students B. Bailey, J. Branscomb & Ford Motor Company)

Automatically generate templates for:
Integrated SimulinkModelica Model
– Modelica (for physics-based modeling)
– Simulink (for controls)

Subsystem modeling
– SME fill in model details
– Validate subsystem models

System-level model integration
– Guaranteed compatibility
– Modelica model integrated into
Simulink
Logical Vehicle
Architecture in SysML
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
Automated
Transformation
45
Taxonomy for Model Transformations in MBSE

Organized by the nature of the knowledge encoded in
the transformation
1. Knowledge about Views
» Take information from a model and represent it in a
different (graphical) syntax
2. Knowledge about Analysis
» Take a structural description of a system and generate
a corresponding analysis model
3. Knowledge about Synthesis
» Generate a (more detailed) structural description

From simple to sophisticated
From specific to general
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
46
Synthesis Rules

Capture heuristic
synthesis knowledge:
What are promising
system architectures?

Difficult to create a
transparent “grammar”
— which architectures
are covered by the
grammar?
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
47
Additional Example of Synthesis Knowledge

Variant modeling — constraint-based representation
of a set of architectures (mbse.gfse.de)
Transformation
One variant
Set of variations

F6 program at JPL: Generation and analysis of
fractionated satellite systems
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
48
Architecture Exploration Using SysML & CPLEX
(Work with former students Alek Kerzhner)
ibd [Block] Hydraulic Subsystem [Hydraulic Subsystem]
A
arm
rod
bucket
rod
boomL
rod
boomR
rod
B
armCylinder : Cylinder
A
housing
armHousing
housing
bucketHousing
housing
boomLHousing
housing
boomRHousing
B
bucketCylinder : Cylinder
A
B
boomCylinderLeft : Cylinder
A
B
boomCylinderRight : Cylinder
P : Hydraulic
rotational : Rotational swingMotor : FixedDisplacementMotor
P [1]
swing
T : Hydraulic
T2
T
powerUnit : PowerUnit [1..4]
P2
rotational : Rotational
out : Rotational
valveBlock : ValveBlock [0..4]
A
B
mover : PrimeMover [1..4]
fuelIn : Fuel
T1
P1
fuel
SE
Problem
1. Formulate Problem in SysML
2. Transform to Superstructure
3. Transform to Introduce Behavior
4. Transform to Linearize
5. Transform to AIMMS syntax
6. Solve using CPLEX
7. Transform solutions into SysML
Generation of Mixed
Integer Programming
model through
transformations
2012 Copyright © Chris Paredis. All Rights Reserved.
AIMMS – CPLEX
MBSE
49
Overview of Presentation

Context — Model Transformations
– What is a model transformation? — some simple examples
– Meta-modeling and Model transformations languages

How can model transformations be useful in MBSE?
– A taxonomy of usage scenarios
– Examples and illustrations


How to get started?
Summary
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
50
How to get started..

Imperative modeling
– Traditional programming languages: Java, Python,…
– Direct use of the APIs of SysML and Analysis tools

Declarative Model Transformation Languages
– ATL, QVT, Moflon, VIATRA2,…
– All are Eclipse based
– Integration of Model Transformation tools into current
SysML tools is not well supported…
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
51
Model Transformation Tools
SysML Tool
Source
Meta-model
Eclipse MMT
refers to
conforms to
Source
Model
Transformation
Specification
Analysis Tool
refers to
executes
reads
Transformation
Engine
Target
Meta-model
conforms to
writes
Target
Model
(Czarnecki, K., & Hellen, S., 2006)
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
52
So What? Should I use Model Transformations?
It depends…

Costs
– Knowledge capture, management is expensive
– Requires “knowledge engineers” who understand how best
to generalize knowledge and encode it in transformations
– Infrastructure

Benefits
– Improved consistency
– Once the knowledge has been captured, the cost of
applying it is very small
– Eliminate tedious, non-value-added tasks in MBSE process
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
53
MBSE
Model-Based
Systems Engineering
Center
Key Take-Aways
1. Model Transformations
– Any operation on a model that produces another model
– Automated model transformations defined at meta-model level
– Model transformation tools in Eclipse
2. Model Transformations in MBSE
– Views: Synchronize views and maintain consistency
– Analysis: Generate analysis models
– Synthesis: Generate promising architectures
3. Cost-Benefit
– Identify simple MBSE tasks that are tedious and error-prone
2012 Copyright © Chris Paredis. All Rights Reserved.
MBSE
54
Download