Towards an Aspect-oriented approach to Agent-oriented programming Matthieu Amiguet – Univ. of Applied Sciences Locle, Switzerland Jose Baez – LIRMM, University of Montpellier, France Adina Nagy – Institut für Informatik, HU Berlin, Germany MOCA 2004 – Aarhus – 11-13 1 October 2004
Outline Introduction: origins, project, methodology, example Aspect-oriented and Agent-Oriented Programming Orthogonal concerns Organizational structure: Concepts, example revisited Agent architecture Dynamic weaving and conflict management Conclusion Future work MOCA 2004 – Aarhus 13.10.2004 2 Adina Nagy
Introduction Origins of organizational approach to agent-oriented programming social-inspired approach „simulation“ for social/behaviour science structuration around patterns of behaviour or of preferences Ex 2. consumer behaviour with respect to brands Ex 1. encapsulation of user-related features in telecom organization schemata and protocols as meta-modelling tools for multi-agent system design [Sauvage, 2003 MOCA project „ m odèle o rganisationnel c entré a gent“ definitions: organizational notions (role, organization) as first-order concepts operationalisation: role-taking defined, endorsement of several roles by an agent treated, agent architecture established, implementation: platform over MadKit (O. Gutknecht, J. Ferber www.madkit.org) MOCA 2004 – Aarhus 13.10.2004 3 Adina Nagy
MOCA organizational approach Social roles: patterns of interaction and behaviour [AMBN´02] behaviourist model versus normative (mentalist) Organisation: institutionalised pattern of interaction, at collective level (social entity) Main properties of MOCA: dynamic social structure issued from agents´ role endorsement [AMBN´02] [Amiguet03] componential agent architecture [Amiguet03] communication through influence exchanges authorized only within a group communication through competence calls within an agent MOCA 2004 – Aarhus 13.10.2004 4 Adina Nagy
Organizational methodology Organization: recurrent pattern of interaction, from a given point of view and often with a rationale Multiple view-point modelling a view-point: a partial view on the whole system modularity, reusability, simplifies the design Multi-organisation modelling each view-point represented by at least an organisation Ex1. Commercial system: good exchanges, financial exchanges, customers’ behaviour Ex2. Multi-agent system: environment negotiation, communication or cheating strategies, as plug-in organisations meta-organisational services reified as particular organisations Ex3. Management organization in MOCA: Group formation and destruction, role endorsement and leave MOCA 2004 – Aarhus 13.10.2004 5 Adina Nagy
Example – a toy commercial system Provider Intermediate Client [Amiguet2003] 3 agents Provider: creates a new group instantiating a Supply org. and takes the Seller role Intermediate: asks to endorse the role Buyer in any group instantianting Supply creates a new group instantiating Selling, where it takes the roles Seller Client: asks to endorse the role Buyer in every group instantianting Selling. MOCA 2004 – Aarhus 13.10.2004 6 Adina Nagy
Outline Introduction: origins, project, methodology Aspect-oriented and Agent-Oriented Programming Orthogonal concerns in MOCA Organizational structure Agent architecture Dynamic weaving and conflict management Conclusion Future work MOCA 2004 – Aarhus 13.10.2004 7 Adina Nagy
Aspect and Agent-oriented programming Agent-Oriented Programming - main decomposition: agents Aspect-Oriented perspective (www.aosd.net) problem: communication elements of communication spread amongts agents scattered/cross-cutting concern Object-Oriented approach: avoid rewritting agents´ code superclass to implement a part of the communication protocols role (organisational approaches) Problems: multiple inheritance + still scatterred protocol MOCA: interaction protocols unified into organizations Agents and Organizations: orthogonal concerns Weaving of concerns through components (roles or not) MOCA 2004 – Aarhus 13.10.2004 8 Adina Nagy
Outline… Introduction: origins, project, methodology Aspect-oriented and Agent-Oriented Programming Orthogonal concerns in MOCA Organizational structure – main concepts Agent architecture Dynamic weaving and conflict management Conclusion Future work MOCA 2004 – Aarhus 13.10.2004 9 Adina Nagy
Organisational concepts Roles (agent-perspective) and role descriptions (organizational perspective) Statechart/ObjectZ representation Example of organizations MOCA 2004 – Aarhus 13.10.2004 10 Adina Nagy
Roles and role descriptions Role description recurrent behaviour pattern at individual level represented as statechart associated to behavioural scripts Role endorsed individual pattern of interaction (and behaviour), interacting with other individual patterns, within a group of agents instantiation of a role description MOCA 2004 – Aarhus 13.10.2004 11 Adina Nagy
Statecharts Extensions of finite-state automata including an and-or decomposition of states [Harel 1987], [for organization schemata modelling: Hilaire 2000] Configurations: Root, A, A1, A2, B, C, D, E Root, F Execution: current configuration determines fireable transitions which determines next configuration root, embedded states and-states (A1, A2) or-states (A, F) default states transitions labelled influence[condition]/action SC- automata whose states are the configurations+ events+ conditions; before firing a transition a simplified graph is computed MOCA 2004 – Aarhus 13.10.2004 12 Adina Nagy
RD example – interaction pattern Contract-net Organization MOCA 2004 – Aarhus 13.10.2004 13 Adina Nagy
Initiator behaviour Initiator RD & role initiator execution start/ send ( cfp ) not- CfpInfluence propose / add_prop understood InfluenceType refuse [ timeout ] / choose name = cfp • A start event attributes = {...} provokes the send of a call_for / send_answer • Call of the _proposals propose / send (reject) competence (multicast) delegate_task influence inform_done failure Inform_refuse • Component Attributes waits timeout influence and proposals: P Proposal records Required competencies chosen:Proposal proposals req_competence = { send, evaluate, timeout } Provided competencies prov_competence = {delegate_task} delegate_task Delegate_task generate_event(start) - which task ? add-prop ∆ Proposal - return a result to the calling component prop ? Competencies scripts for proposals’ = proposal prop? choose ∆ chosen Internal competencies p proposals evaluate ( chosen’ ) evaluate (p) ObjectZ, Java interfaces send_answers p proposals - { chosen } send( p,reject) MOCA 2004 – Aarhus 13.10.2004 14 Adina Nagy send (chosen,accept)
Role descriptions (reminder) RD - recurrent behaviour pattern at individual level Combined formalism statechart representation (interactions) competencies behaviour scripts in ObjectZ (XML files, Java interfaces) Transitions - labelled - enacting_event[condition]/action enacting_event is an influence type condition and action are competence calls Competencies internal to roles external: required or provided MOCA 2004 – Aarhus 13.10.2004 15 Adina Nagy
Example - Org. Supply Require Organisation: Purse- related competenc e Behaviour: Buyer asks Seller the price of a good and buys until has no more money left MOCA 2004 – Aarhus 13.10.2004 16 Adina Nagy
Example - Org. Selling m Buyer orders at random intervals a given quantity of goods to Seller If Seller has enough stock, it delivers the required amount, else it refuses delivery Require Purse-related competencies MOCA 2004 – Aarhus 13.10.2004 17 Adina Nagy
Example Provider Intermediate P u r s e MOCA 2004 – Aarhus 13.10.2004 18 Adina Nagy
Outline Introduction: origins, project, methodology Aspect-oriented and Agent-Oriented Programming Orthogonal concerns in MOCA Organizational structure: main concepts Representation of interaction protocols (RD+relations) Independent of agents‘ architecture first orthogonal concern Agent architecture Dynamic weaving and conflict management Conclusion Future work MOCA 2004 – Aarhus 13.10.2004 19 Adina Nagy
Agent architecture - PN ? componential Agent type problem dependent encapsulates goals, etc driver for role endorsement/leave Agent Type components Manage which components Componential add/removal components CMM ? added/removed CMM not specified in MOCA Influences Components management of are sent by a communication specific Components between component components Components Management Module provides agent with primitives to manage components Influences received and dispatched to roles MOCA 2004 – Aarhus 13.10.2004 20 Adina Nagy
Recommend
More recommend