Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
A Layered Architecture for the Model-driven Development of Distributed Simulators
1. March 3-7, 2008
Marseille, France
A Layered Architecture for the
Model-driven Development of
Distributed Simulators
Daniele Gianni* Andrea D’Ambrogio# Giuseppe Iazeolla#
(*) Dept. of Electrical & Electronic Eng. (#) Dept. of Computer Science
Imperial College London University of Roma “Tor Vergata”
London (UK) Roma (Italy)
2. Overview
Motivations
Definition of SimArch
• Layers, Service Interfaces and Data Interfaces
Example implementation of a SimArch-based
simulation language
• jEQN
Application to the model-driven development
of a distributed simulator
SIMUTools'08 2
3. Motivations
The development of distributed simulators generally
requires more effort and know-how compared to
centralized (local) simulators
Only reusability and interoperability aspects have been
addressed by distributed simulation approaches
Adaptability aspects (how to switch from local to
distributed simulation) have not been addressed
The proposed layered architecture exploits model-driven
development to allow the simulation developer to
abstract from the execution environment and to deal
only with the definition of the hi-level simulation model
SIMUTools'08 3
4. SimArch
A layered architecture to enable the model-
driven development of distributed simulators:
• transparent deployment of simulation
components in either a local or a distributed
environment
• transparent introduction/modification of the
layers’ implementation to meet additional/specific
requirements
• definition of custom (domain-specific) simulation
languages on top of the layered architecture
SIMUTools'08 4
5. SimArch Main Characteristics
Based on the process interaction paradigm
Composed of four layers
Based on the definition of:
• Service interfaces
• Data interfaces
• Factory interfaces for component instantiation
SIMUTools'08 5
6. Process Interaction Paradigm
ev2
Key
E2
ev1
Entity
E1 Input Port
ev3 Output Port
E3
Link/Event ev
ev4
SIMUTools'08 6
9. SimArch Service Interfaces
(layers 23)
«interface» «interface»
Layer3ToLayer2 Layer2ToLayer3
+getUserInterface() : Layer3toLayer2UserInterface
+body()
+getDeveloperInterface() : Layer3ToLayer2DeveloperInterface
+getId() : Integer
+getEntityName() : Name
+printStatistics()
+setEventReceived()
+setReceivedEvent(in event : Event)
+setId(in id : Integer)
+setSystemName(in name : Name)
«interface» «interface»
Layer3toLayer2UserInterface Layer3ToLayer2DeveloperInterface
+registerEntity(in entity : GeneralEntity) +getClock() : Time
+start() +waitNextEvent()
+hold(in time : Time)
+holdUnlessIncomingEvent(in time : Time) : Boolean
+send(in entity : Entity, in delay : Time, in tag : Enum, in data : Object)
+send(in port : OutputPort, in delay : Time, in tag : Enum, in data : Object)
+send(in recipient : Name, in delay : Time, in tag : Enum, in data : Object)
SIMUTools'08 9
10. SimArch Data Interfaces (1/2)
«interface»
Link
+getInputPorts() : List of InputPort
+getOutputPorts() : List of OutputPort
+isAllowedToSendThroughThisLink() : Boolean
«interface»
GeneralEntity
+getEntityId() : Integer
+getEntityName() : Name
«interface» +getFullName() : Name
Port +getSystemName() : Name
+isLocal() : Boolean
+getOwner() : GeneralEntity
+getLink() : Link
«interface» «interface» «interface» «interface»
InputPort OutputPort ComponentLevelEntity RemoteEntity
SIMUTools'08 10
11. SimArch Data Interfaces (2/2)
«interface»
«interface»
Comparable
Event
+getData() : Object
+getRecipient() : GeneralEntity
«interface» +getRecipientName() : Name
Time +getSender() : GeneralEntity
+decreaseBy() +getSenderName() : Name
+decreasedBy(in time : Time) : Time +getTag() : Enum
+getValue() : Double +getTime() : Time
+increaseBy(in time : Time)
+increasedBy(in time : Time) : Time
+isEqualTo(in time : Time) : Boolean «interface»
+isGreaterOrEqualThan(in time : Time) : Boolean Name
+isGreaterThan(in time : Time) : Boolean +getValue() : String
+isLesserOrEqualThan(in time : Time) : Boolean +setValue(in name : String)
+isLesserThan(in time : Time) : Boolean
+setValue(in time : Double)
SIMUTools'08 11
12. SimArch implementation status
Layer 1
• DDESoverHLA library: provides a DES
abstraction on top of HLA
Layer 2
• SimJ library: provides generic simulation
components
Layer 3
• jEQN library: provides the primitives for
defining EQN simulation models
SIMUTools'08 12
14. Domain Specific Language (DSL)
Programming language
Domain-specificity
Increased expressiveness (decreased
generality)
Ease-of-use
Reduced domain and programming
expertise
Verificability and transformability
Declarative
Enabler of reuse
SIMUTools'08 14
15. jEQN: a DSL for EQNs
Based on:
• Domain analysis of EQN models
• Declarative approach (specify what to simulate
rather then how to simulate)
Used to:
• Reduce the semantic gap between the model
specification and the corresponding simulation
program
Composed of:
• Simulation services defined by SimArch
• Set of EQN simulation components
• Set of parameters for the components
SIMUTools'08 15
16. jEQN Simulation Components
Derived from EQN domain analysis
6 groups:
• user sources
• waiting systems
• service centers
• routers
• special nodes
• support components
SIMUTools'08 16
17. jEQN Parameters
Design guidelines:
• Decouple jEQN simulation components from
the parameters that do not affect the
simulation logic
• Flexible parameter structure to allow the
incorporation of additional parameter types
SIMUTools'08 17
18. Example candidate parameters
• For user source components:
termination condition
interarrival time
user generation
• For waiting system components:
preemptive waiting systems
preemption policy
queue structure
service request generator
enqueueing and dequeuing policy
SIMUTools'08 18
19. Categories of Parameters
1. Parameters used to take decisions
• routing policy, enqueueing policy
2. Parameters that provide sequence of
values
• interarrival times, service request times
(incorporating jRand)
3. Parameters that provide storage support
• queues
SIMUTools'08 19
20. Category-1 parameters
• Organized around four variables:
T: the decision data
I: the input data
S: the state data
D: the type of decision
• According to the use of such variables, for
example:
StateOnlyDecisionPolicy
InputOnlyDecisionPolicy
SIMUTools'08 20
21. Category-1 parameters
«interface»
Policy
«interface» «interface»
InputPolicy StatePolicy<S>
+getDecision() : D
+getState() : S
+setState(in s : S)
«interface»
ImplicitInputPolicy<I> «interface» «interface»
ExplicitInputPolicy<T extends DecisionData, InputAndStatePolicy
+getImplicitInput() : I D> StateOnlyDependentPolicy<S, D>
+setImplicitInput(in i : I)
+getDecisionFor(in t : T) : D -state : S
+getDecision() : D
«interface» ImplicitAndExplicitInputDependentPolicy<I, ExplicitInputOnlyDependentPolicy<T,D>
ImplicitButNotExplicitPolicy<I,D> T,D>
+getDecisionFor() : D -implicitInput : I
ImplicitButNotExplicitInputDependentPolicy<
I,D> ImplicitAndExplicitInputAndStateDependentPolicy<
-implicitInput : I I,S,T,D>
+getDecision() : D -state : S
+getImplicitInput() : I
+setImplicitInput(in i : I)
ImplicitButNotExplicitInputAndStateDependentPolicy<
I,S,D>
-state : S
+getState() : S
+setState(in s : S)
SIMUTools'08 21
24. The Catenet System
Host A
LAN1 (token ring)
WAN
Host B
GW1 GW2
LAN2 (ethernet)
catenet
SIMUTools'08 24
25. EQN Model
(high-level)
catenet
GET
TCP
Source LAN1 LLC/
GW1
IP
TCP TCP IP
(Host A) MAC802.5
Host A
X.25
network layers
WAN
X.25
Host B
network layers
RELEASE
Sink
TCP
LLC/
IP
GW2 MAC802.3
LAN2 IP TCP TCP
(Host B)
Window
Size C
Token
Pool
SIMUTools'08 25
27. Model-driven Development (1/3)
Direct mapping between EQN model
entities and SimArch/jEQN
SimArch statements: environment set-up,
connections between jEQN components
jEQN components: model entities and
their parameters
SIMUTools'08 27
28. Model-driven Development (2/3)
EQN model entities and jEQN components:
Service Center jEQN Service Center
Waiting System jEQN Waiting System
Passive Queue (Pool of Tokens, Activate and Release
Nodes) jEQN Special Nodes
EQN entity properties and parameters (to be set at
instantiation time) of jEQN components:
Enqueueing policy: FIFO
Service Time: Normal Stream
Operation: setSender (for setSender node)
SIMUTools'08 28
29. Model-driven Development (3/3)
Extra jEQN components for the routing
information (implicitly included in the EQN
model)
Parameterization of jEQN components
according to the model properties (service
time, enqueueing policy, routing policy, etc.)
SIMUTools'08 29
32. Local Simulator Development
1. Instantiate a Layer 2 implementation
(Execution Container)
2. Declare and define jEQN components
according to the previous guidelines
3. Connect components
4. Activate the execution container
SIMUTools'08 32
33. From Local to Distributed
1. Partition the model
2. Configure Layer1 components (e.g.
FederationManager, with, e.g., number
of simulators, lookahead, etc.)
3. Code each simulator (federate)
SIMUTools'08 33
34. Model Partitioning
Submodel 0
Host A
LAN1 (token ring)
WAN Submodel 2
Host B
GW1 Submodel 1
GW2
LAN2 (ethernet)
SIMUTools'08 34
35. Coding the distributed simulator
1. Instantiation of a distributed implementation of Layer 2,
which in turns requires Layer 1
2. Declaration and definition of jEQN components
1. Local: as in the local simulator
2. Remote: use of SimArch RemoteEntity
3. Connection between jEQN components
1. Local-Local: as in the local simulator
2. Local-Remote: similarly to local connection, with a
local proxy for the RemoteEntity
4. Activation of the execution container
SIMUTools'08 35
36. Simulators deployment
US - Georgia Italy
jEQN
Simulator
jEQN
SimArch Simulator
HLA over IIOP CORBA-HLA
Client
SimArch
GATech's CORBA -HLA
jEQN
Simulator
LAN WAN Camerino
Client
HLA over IIOP SimArch
Ascoli CORBA -HLA
Client
Ge orgia Te ch
HLA o
ve r IIOP
TorVe rgata
CORBA RTI Server
CORBA-HLA
Client Le cce
SimArch
jEQ N
Simulator
SimLab
Key
Federate
CORBA-HLA CORBA-HLA CORBA-HLA
Client Client Client
IIOP protocol
Server
Pitch protocol over TCP and UDP Executive
Federation
Manager SimArch SimArch
pRTI 1516
jEQ N jEQ N
Simulator Simulator Local
CORBA + CORBA-HLA
SIMUTools'08 36
39. Conclusions
SimArch eases the development of
distributed simulators by introducing a set
of layered abstract simulation services on
top of the distributed environment
SimArch advantages:
• Reduces development effort and time
• Does not need specialized distributed
simulation skills
• Facilitates the introduction of simulation
languages as DSLs (e.g., jEQN)
SIMUTools'08 39