et Olivier Marc

Download Report

Transcript et Olivier Marc

Marzhin:
Simulation multi-agents de modèles AADL
Ecole d’été du Temps-Réel
Brest, 31 août 2011
Ellidis s
Technologies
w w w . e l l id is s . c o m
Pierre Dissaux
Olivier Marc
Ellidis s
Technologies
w w w . e l l id is s . c o m
AADL Centric
tool strategy
STOOD
graphical editors
CHEDDAR
real-time
analysis
HOOD-AADL-UML
ADELE
graphical editor
TOPCASED/SPICES
AADL
Inspector
MARTE to AADL
model transformation
static rules checkers:
- AADL Legality rules
- AADL Naming rules
- AADL Consistency rules
- Metrics
- Project specific rules
TOPCASED/LAMBDA
TASTE
graphical editor
ASSERT
Other domain specific
graphical editors
MARZHIN
multi-agent
model animation
bridge to other
AADL tools
OSATE, OCARINA
Ellidis s
Technologies
w w w . e l l id is s . c o m
AADL
• Architecture Analysis and Design Language
• Standard international SAE AS5506A, janvier 2009
• Langage de modélisation de systèmes intégrant
les applicatifs logiciels et leurs plateformes d’exécution
• Langage principalement textuel
• Sémantique précise permettant l’analyse des modèles
• Langage extensible par ajout de propriétés et d’annexes
www.aadl.info
Le « multi-agents »
Agent
Une définition parmi d'autres :
« Un agent est une entité autonome, réelle ou abstraite, qui est capable
d’agir sur elle-même et sur son environnement, qui, dans un univers multiagents, peut communiquer avec d’autres agents, et dont le comportement
est la conséquence de ses observations, de ses connaissances et des
interactions avec les autres agents. »
Propriétés :
• Autonomie.
• Action.
• Perception.
• Communication.
Le « multi-agents »
Système multi-agents (SMA)
Environnement d'exécution distribué composé
d'un ensemble d'agents.
Propriétés :
• Chaque agent a un point de vue limité de l'environnement.
• Pas de contrôle central.
• Les comportements des agents sont asynchrones.
• Un but à réaliser conjointement par les agents.
Le « multi-agents »
Domaines d'application des SMA
• Télécommunication (aspect distribué).
• Data mining (WEB).
• Ethologie.
• Jeux vidéo.
Le « multi-agents »
Exemple : Simulateur de vol hirondelle.
Vidéo...
Le « multi-agents »
Exemple : Simulateur de vol hirondelle.
Le « multi-agents »
Exemple : Foule
Vidéo...
Le « multi-agents »
Mise en œuvre des SMA :
• Agent : entité logiciel de type objet avec une ou
plusieurs unité(s) d'exécution.
• Ordonnanceur gérant les unités d'exécution des
agents. (ordre prédéfini, ordre aléatoire...)
Le « multi-agents »
SMA et MARZHIN :
Concepts retenus :
• Description locale des agents → modélisation simple.
1 entité AADL = 1 agent.
• Comportements locaux → comportement global.
• Ordonnanceur simple et maîtrisé n'appelant que les unités
d'exécution des agents.
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
historique
• fin 2007: étude de faisabilité
• 2008-2010: développement du simulateur
travaux sur fonds propres
• juin 2009: démonstration lors du workshop AADL
• 2010: intégration dans l’outil TASTE-CV
contrat ESA
• 2011: intégration dans l’outil AADL Inspector
travaux sur fonds propres
• août 2011: sortie commerciale de AADL Inspector 1.0
téléchargement sur www.ellidiss.com
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
overview
• Multi-agents simulator:
• minimalistic scheduler
• behavior is distributed over the threads
• based on an existing multi-agents engine developed by Virtualys
• runs on a JRE
• AADL support:
• (single) processor
• threads
• event ports
• shared data access
• subprogram calls
• behavior annex
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
AADL processor
Supported Scheduling Protocols
Rate_Monotonic_Protocol
each thread must have a Period
Deadline_Monotonic_Protocol
each thread must have a Deadline
POSIX_1003_Highest_Priority_Fir each thread must have a Priority
st_Protocol
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
AADL thread states
Suspende
d
Call remote
subprogram
Dispatch
Ready
Preempt
Resume
Awaiting
Return
Running
Return remote
subprogram
Complete
Block due to
Get Resource
Unblock due to
Release Resource
Awaiting
Resource
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
AADL thread dispatch protocols
Supported Dispatch Protocols
Periodic
dispatched periodically with specified Period
Aperiodic
dispatched by received events
Sporadic
same as Aperiodic, with a minimum inter-arrival
time (Period)
same as Aperiodic, with a timeout
Timed
Hybrid
Background
disjunction of Periodic and Aperiodic dispatch
conditions
dispatched when the processor is free
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
AADL thread features
Supported Thread Features
Event Port
used to dispatch Aperiodic, Sporadic,
Timed and Hybrid threads
Event Data Port
same as Event Port
Provides
Subprogram Access
same as Event Port
Requires
Subprogram Access
used to express a remote subprogram
call
Requires Data
Access
used to express a remote data access
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
AADL thread properties
Period
Deadline
Supported Thread Properties
required for Periodic, Sporadic, Timed and
Hybrid threads
required when the scheduling protocol is
Deadline_Monotonic_Protocol
Priority
required when the scheduling protocol is
POSIX_1003_Highest_Priority_First_Protocol
Compute_Execution_
Time
required when no behaviour annex is specified
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
AADL feature and data properties
Supported Feature Properties
Queue_Size
specifies the maximum number of stored
events (default is 1)
Dequeue_Protocol may be OneItem or AllItems
Supported Data Properties
Concurrency_Control_Protocol
can be used to ensure mutually
exclusive access with:
Priority_Ceiling_Protocol
Ellidis s
Technologies
w w w . e l l id is s . c o m
Marzhin
AADL behavior annex
The AADL behavior annex defines an action language to
describe the internal behavior of a thread or a subprogram
Supported Behavior Annex Actions
Computation specify use of the processor for a given duration
!<
specify lock of a shared data (GetResource)
!>
specify unlock of a shared data (ReleaseResource)
!
specify send of an out event or call of a subprogram
ANNEX Behavior_Specification {**
states
s : initial complete final state;
transitions
t : s -[on dispatch]-> s
{ buffer !<; computation(2 ms); send !; buffer !> };
**};
Ellidis s
Technologies
w w w . e l l id is s . c o m
AADL to Marzhin
model transformation
Prolog
rules
AADL
files
Marzin
.jar files
Prolog
predicates
aadlrev
XML
file
sbprolog
LMP
Simulation
trace
JRE
Ellidis s
Technologies
w w w . e l l id is s . c o m
Case Studies:
Real-Time patterns
• Modelling and analysis process:
• build the architectural model with Stood
• generate the AADL specification
• simulate within AADL Inspector
• Real-Time communication patterns:
• Synchronous dataflow
• Message sending
• Shared data
• Client-server
Ellidis s
Technologies
w w w . e l l id is s . c o m
Synchronous dataflow
PACKAGE synchronous
PUBLIC
WITH HW;
SYSTEM synchronous
END synchronous;
SYSTEM IMPLEMENTATION synchronous.others
SUBCOMPONENTS
my_process : PROCESS my_process.others;
my_platform : SYSTEM HW::RMA_board;
PROPERTIES
Actual_Processor_Binding => ( reference(my_platform.cpu) )
applies to my_process;
END synchronous.others;
PROCESS my_process
END my_process;
PROCESS IMPLEMENTATION my_process.others
SUBCOMPONENTS
T1 : THREAD a_thread
{ Dispatch_Protocol => Periodic;
Compute_Execution_Time => 5 ms .. 5 ms;
Period => 25 ms; };
T2 : THREAD a_thread
{ Dispatch_Protocol => Periodic;
Compute_Execution_Time => 5 ms .. 5 ms;
Period => 20 ms; };
T3 : THREAD a_thread
{ Dispatch_Protocol => Periodic;
Compute_Execution_Time => 5 ms .. 5 ms;
Period => 15 ms; };
CONNECTIONS
PORT T1.output -> T2.input;
PORT T2.output -> T3.input;
END my_process.others;
THREAD a_thread
FEATURES
input : IN DATA PORT Base_Types::integer;
output : OUT DATA PORT Base_Types::integer;
END a_thread;
END synchronous;
Ellidis s
Technologies
w w w . e l l id is s . c o m
Message sending
PACKAGE messages
PUBLIC
WITH Behavior_Properties;
WITH HW;
SYSTEM messages
END messages;
SYSTEM IMPLEMENTATION messages.others
SUBCOMPONENTS
my_platform : SYSTEM HW::RMA_board;
my_process : PROCESS my_process.others;
PROPERTIES
Actual_Processor_Binding => ( reference(my_platform.cpu) )
applies to my_process;
END messages.others;
PROCESS my_process
END my_process;
PROCESS IMPLEMENTATION my_process.others
SUBCOMPONENTS
sender : THREAD sender.others;
receiver : THREAD receiver;
CONNECTIONS
PORT sender.send -> receiver.receive;
END my_process.others;
THREAD sender
FEATURES
send : OUT EVENT PORT;
END sender;
THREAD IMPLEMENTATION sender.others
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 5ms..7ms;
Period => 20ms;
ANNEX Behavior_Specification {**
states
s : initial complete final state;
transitions
t : s -[on dispatch]-> s
{ computation(3 ms); send !;computation(3 ms);send ! };
**};
END sender.others;
THREAD receiver
FEATURES
receive : IN EVENT PORT
{ Dequeue_Protocol => OneItem;
Queue_Size => 5; };
PROPERTIES
Dispatch_Protocol => Sporadic;
Compute_Execution_Time => 2ms..2ms;
Period => 21ms;
END receiver;
END messages;
Ellidis s
Technologies
w w w . e l l id is s . c o m
Shared data
PACKAGE shared_data
PUBLIC
WITH HW;
-PROCESS IMPLEMENTATION my_process.others
SUBCOMPONENTS
T1 : THREAD T.i1;
D1 : DATA D
{ Concurrency_Control_Protocol => PRIORITY_CEILING_PROTOCOL; };
D2 : DATA D
{ Concurrency_Control_Protocol => PRIORITY_CEILING_PROTOCOL; };
T2 : THREAD T.i2;
CONNECTIONS
DATA ACCESS D1 -> T1.D1;
DATA ACCESS D2 -> T1.D2;
DATA ACCESS D1 -> T2.D1;
DATA ACCESS D2 -> T2.D2;
END my_process.others;
THREAD T
FEATURES
D1 : REQUIRES DATA ACCESS D;
D2 : REQUIRES DATA ACCESS D;
END T;
THREAD IMPLEMENTATION T.i1
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 5ms..5ms;
Period => 15 ms;
ANNEX Behavior_Specification {**
states
s : initial complete final state;
transitions
t : s -[on dispatch]-> s
{ D1 !<; computation(3 ms);D2 !<;D2 !>; D1 !> };
**};
END T.i1;
DATA D
END D;
THREAD IMPLEMENTATION T.i2
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 5ms..5ms;
Period => 20 ms;
ANNEX Behavior_Specification {**
states
s : initial complete final state;
transitions
t : s -[on dispatch]-> s
{ D2 !<; computation(5 ms); D1 !<; D1 !>; D2 !> };
**};
END T.i2;
END shared_data;
Ellidis s
Client-server
Technologies
w w w . e l l id is s . c o m
ACKAGE client_server
PUBLIC
WITH HW;
SYSTEM client_server
END client_server;
SYSTEM IMPLEMENTATION client_server.others
SUBCOMPONENTS
my_platform : SYSTEM HW::RMA_board;
my_process : PROCESS my_process.others;
PROPERTIES
Actual_Processor_Binding => ( reference(my_platform.cpu) )
applies to my_process;
END client_server.others;
PROCESS my_process
END my_process;
PROCESS IMPLEMENTATION my_process.others
SUBCOMPONENTS
client_T : THREAD client_T.others;
server_T : THREAD server_T;
CONNECTIONS
SUBPROGRAM ACCESS server_T.start -> client_T.start;
END my_process.others;
THREAD client_T
FEATURES
start : REQUIRES SUBPROGRAM ACCESS start;
END client_T;
THREAD IMPLEMENTATION client_T.others
PROPERTIES
Dispatch_Protocol => Periodic;
Compute_Execution_Time => 5ms..7ms;
Period => 15 ms;
ANNEX Behavior_Specification {**
states
s : initial complete final state;
transitions
t : s -[on dispatch]-> s
{ computation(2 ms); start !; computation(4 ms)
**};
END client_T.others;
THREAD server_T
FEATURES
start : PROVIDES SUBPROGRAM ACCESS start
{ Compute_Execution_Time => 3ms..3ms; };
PROPERTIES
Dispatch_Protocol => Sporadic;
Compute_Execution_Time => 2ms..4ms;
Period => 5 ms;
END server_T;
SUBPROGRAM start
END start;
END client_server;
};
Ellidis s
Technologies
w w w . e l l id is s . c o m
Conclusion
• Le standard AADL définit une sémantique d’exécution
suffisamment précise pour permettre la mise en œuvre de
simulations au niveau modèle.
• La technologie multi-agents offre une solution simple et
évolutive pour réaliser un simulateur léger.
• MARZHIN est à ce jour intégré dans la chaîne d’outils
TASTE et dans le produit commercial AADL Inspector
• De nombreuses pistes d’amélioration sont à l’étude:
• gestion des architectures multi-processeur
• gestion des modes AADL
• prise en compte plus complète de l’annexe comportementale AADL
• meilleure gestion des unités de temps
• ajout d’une interface d’entrée pour modèles UML/MARTE
• amélioration de la visualisation des chronogrammes
• pilotage d’une animation du modèle d’architecture
• pilotage d’une animation virtuelle de l’application