marzhin: simulation multi-agents de modèles aadl
Post on 21-Jan-2016
50 Views
Preview:
DESCRIPTION
TRANSCRIPT
Marzhin: Simulation multi-agents de modèles AADL
Ecole d’été du Temps-RéelBrest, 31 août 2011
EllidissTechnologiesw w w . e l l i d i s s . c o m
Pierre Dissaux Olivier Marc
TO PCASEDh ttp :/ /w w w.topcased .o rg
CHEDDARreal-timeanalysis
TASTEgraphical editor
ASSERT
ADELEgraphical editor
TOPCASED/SPICES
STOODgraphical editorsHOOD-AADL-UML
MARZHINmulti-agent
model animation
AADL Centrictool strategy
EllidissTechnologiesw w w . e l l i d i s s . c o m
AADL Inspector
static rules checkers:- AADL Legality rules - AADL Naming rules- AADL Consistency rules- Metrics- Project specific rules
bridge to other AADL tools
OSATE, OCARINAOther domain specific
graphical editors
MARTE to AADLmodel transformation
TOPCASED/LAMBDA
AADL Centrictool strategy
EllidissTechnologiesw w w . e l l i d i s s . c o m
AADLEllidissTechnologiesw w w . e l l i d i s s . c o m
AADLEllidissTechnologiesw w w . e l l i d i s s . c o m
• 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 multi-agents, 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.
EllidissTechnologiesw w w . e l l i d i s 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
Marzhinoverview
EllidissTechnologiesw w w . e l l i d i s s . c o m
• 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
MarzhinAADL processor
EllidissTechnologiesw w w . e l l i d i s s . c o m
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_First_Protocol
each thread must have a Priority
MarzhinAADL thread states
EllidissTechnologiesw w w . e l l i d i s s . c o m
Suspended
Ready
Running
Awaiting Resource
Awaiting Return
Dispatch
Resume
Preempt
Block due to Get Resource
Complete
Unblock due to Release Resource
Call remote subprogram
Return remote subprogram
MarzhinAADL thread dispatch protocols
EllidissTechnologiesw w w . e l l i d i s s . c o m
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)
Timed same as Aperiodic, with a timeout
Hybrid disjunction of Periodic and Aperiodic dispatch conditions
Background dispatched when the processor is free
MarzhinAADL thread features
EllidissTechnologiesw w w . e l l i d i s s . c o m
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
MarzhinAADL thread properties
EllidissTechnologiesw w w . e l l i d i s s . c o m
Supported Thread Properties
Period required for Periodic, Sporadic, Timed and Hybrid threads
Deadline required when the scheduling protocol is Deadline_Monotonic_Protocol
Priority required when the scheduling protocol isPOSIX_1003_Highest_Priority_First_Protocol
Compute_Execution_Time
required when no behaviour annex is specified
MarzhinAADL feature and data properties
EllidissTechnologiesw w w . e l l i d i s s . c o m
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
MarzhinAADL behavior annex
EllidissTechnologiesw w w . e l l i d i s s . c o m
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
The AADL behavior annex defines an action language to describe the internal behavior of a thread or a subprogram
ANNEX Behavior_Specification {** states s : initial complete final state; transitions t : s -[on dispatch]-> s { buffer !<; computation(2 ms); send !; buffer !> };**};
EllidissTechnologiesw w w . e l l i d i s s . c o m
AADL to Marzhinmodel transformation
AADLfiles
Prologpredicates
Prologrules
XMLfile
Marzin.jar files
Simulationtrace
aadlrev
sbprolog
JRELMP
EllidissTechnologiesw w w . e l l i d i s 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
PACKAGE synchronousPUBLICWITH HW;
SYSTEM synchronousEND synchronous;
SYSTEM IMPLEMENTATION synchronous.othersSUBCOMPONENTS 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_processEND my_process;
PROCESS IMPLEMENTATION my_process.othersSUBCOMPONENTS 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_threadFEATURES input : IN DATA PORT Base_Types::integer; output : OUT DATA PORT Base_Types::integer;END a_thread;
END synchronous;
EllidissTechnologiesw w w . e l l i d i s s . c o m Synchronous dataflow
PACKAGE messagesPUBLICWITH Behavior_Properties;WITH HW;
SYSTEM messagesEND messages;
SYSTEM IMPLEMENTATION messages.othersSUBCOMPONENTS 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_processEND my_process;
PROCESS IMPLEMENTATION my_process.othersSUBCOMPONENTS sender : THREAD sender.others; receiver : THREAD receiver;CONNECTIONS PORT sender.send -> receiver.receive;END my_process.others;
THREAD senderFEATURES send : OUT EVENT PORT;END sender;
THREAD IMPLEMENTATION sender.othersPROPERTIES 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 receiverFEATURES 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;
EllidissTechnologiesw w w . e l l i d i s s . c o m Message sending
PACKAGE shared_dataPUBLICWITH HW;
--
PROCESS IMPLEMENTATION my_process.othersSUBCOMPONENTS 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 TFEATURES D1 : REQUIRES DATA ACCESS D; D2 : REQUIRES DATA ACCESS D;END T;
THREAD IMPLEMENTATION T.i1PROPERTIES 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 DEND D;
THREAD IMPLEMENTATION T.i2PROPERTIES 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;
EllidissTechnologiesw w w . e l l i d i s s . c o m Shared data
ACKAGE client_serverPUBLICWITH HW;
SYSTEM client_serverEND client_server;
SYSTEM IMPLEMENTATION client_server.othersSUBCOMPONENTS 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_processEND my_process;
PROCESS IMPLEMENTATION my_process.othersSUBCOMPONENTS 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_TFEATURES start : REQUIRES SUBPROGRAM ACCESS start;END client_T;
THREAD IMPLEMENTATION client_T.othersPROPERTIES 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_TFEATURES 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 startEND start;
END client_server;
EllidissTechnologiesw w w . e l l i d i s s . c o m Client-server
EllidissTechnologiesw w w . e l l i d i s 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
top related