27
Marzhin: Simulation multi-agents de modèles AADL Ecole d’été du Temps-Réel Brest, 31 août 2011 Ellidi Technologies w w w . e l l i d i s Pierre Dissaux Olivier Marc

Marzhin: Simulation multi-agents de modèles AADL

  • Upload
    adolph

  • View
    46

  • Download
    0

Embed Size (px)

DESCRIPTION

Marzhin: Simulation multi-agents de modèles AADL. Ecole d’été du Temps-Réel Brest, 31 août 2011. Pierre Dissaux. Olivier Marc. AADL Centric tool strategy. AADL Centric tool strategy. STOOD graphical editors HOOD-AADL-UML. CHEDDAR real-time analysis. ADELE graphical editor - PowerPoint PPT Presentation

Citation preview

Page 1: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 2: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 3: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 4: Marzhin:  Simulation multi-agents de modèles AADL

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.

Page 5: Marzhin:  Simulation multi-agents de modèles AADL

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.

Page 6: Marzhin:  Simulation multi-agents de modèles AADL

Le « multi-agents »

Domaines d'application des SMA

• Télécommunication (aspect distribué).• Data mining (WEB).• Ethologie.• Jeux vidéo.

Page 7: Marzhin:  Simulation multi-agents de modèles AADL

Le « multi-agents »

Exemple : Simulateur de vol hirondelle.

Vidéo...

Page 8: Marzhin:  Simulation multi-agents de modèles AADL

Le « multi-agents »

Exemple : Simulateur de vol hirondelle.

Page 9: Marzhin:  Simulation multi-agents de modèles AADL

Le « multi-agents »Exemple : Foule

Vidéo...

Page 10: Marzhin:  Simulation multi-agents de modèles AADL

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...)

Page 11: Marzhin:  Simulation multi-agents de modèles AADL

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.

Page 12: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 13: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 14: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 15: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 16: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 17: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 18: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 19: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 20: Marzhin:  Simulation multi-agents de modèles AADL

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 !> };**};

Page 21: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 22: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 23: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 24: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 25: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 26: Marzhin:  Simulation multi-agents de modèles AADL

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

Page 27: Marzhin:  Simulation multi-agents de modèles AADL

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