Title: Agents and Objects: An Empirical Study on the Design and Implementation of MASs
1Agents and Objects An Empirical Study on
theDesign and Implementation of MASs
PUC-Rio
Alessandro Garcia Claudio SantAnna
Christina Chavez Viviane Silva Carlos Lucena
Arndt von Staa
SoCAgents Group
www.teccomm.les.inf.puc-rio.br/SoCAgents
May 3rd, 2003
2Motivation
- Complexity of modern software systems
- Emergent features and application domains
- Distribution and Openness
- Knowledge Integration
- Mobile Computing
- Fact new properties into the software systems
- Goal-orientation, autonomy, adaptation,
collaboration, mobility, intelligence
!
- Pervasive Computing
- E-Commerce
- Personalization
Agent Properties
3The Problem
- Object vs. Agent Properties
- the features of objects and classes are not
directly aligned with agency features - To what extent do OO abstractions produce MAS
design and code that is reusable and
maintainable? - explicit separation of concerns
- low coupling and high cohesion
4Agents vs. Objects Limited Understanding
GAIA, Common-KADS, Tropos, MAS-ML, AUML...
Design Patterns Kendall, 1999
T-Rex, JADE, Retsina, JAFIMA, ZEUS,
5Lack of Empirical Studies
- Several researchers say Forget objects Lets
construct a new software engineering, new design
methods and techniques, new programming languages
from the scratch Objects and agents are entities
essentially different! - Arguments are not based on empirical evidence
- Limited understanding about the interplay between
object and agent properties in practice
6Past Experience with MAS Engineering (I)
Fact 1 Poor Separation of Agency Concerns
MAS 1 Web Development Environment
MAS 2 Web Searcher
MAS 3 Virtual Market
MAS 4 Negotiation
7Past Experience with MAS Engineering (II)
Fact 2 Lack of reuse of identical roles and
agent types Fact 3 Lack of reuse of agent
services Fact 4 Agent Schizophrenia Potenti
al Problem Causes 1 OO abstractions do not
provide suitable support for reuse and
maintenance of MASs 2 OO abstractions are OK
the investigated MASs were not well structured
according common change and reuse concerns
8Our Work (I)
- An Empirical Study
- Goal Improve our knowledge about the interplay
between agency concerns and OO abstractions - Comparison
- Pattern-Oriented Development classes, patterns,
- Aspect-Oriented Development classes, aspects,
- 3 Viewpoints Construction, Maintenance and Reuse
- MAS concerns were identified from different
sources - Literature examples and MASs developed at our lab
- Agent-oriented design and programming languages
-
9Our Work (II)
- Agents vs. Objects
- Objects
- State attributes
- Behavior methods
- Agents objects with attitude
- State beliefs, actions, and goals
- Behavior actions, properties (autonomy,
adaptation, interaction, ) - Objects as building blocks of agents
- Reactive agents
- Large-scale MASs
- Different agent types and roles
- Multiple properties
10An Example Portalware MS
- Agent Types
- Interface Agent
- User Agent
- Information Agent
- Naming Agent
- Roles
- User Agent editor, content supplier, reviewer
- Information Agent caller and answerer
11An Example Portalware
- Types of Agents in Portalware
Information Agents
Interface Agents
User Agents
Naming Agents
Collaboration
Software Agents
Learning
Learning
Mobility
Adaptation
Interaction
Autonomy
12The Pattern-Oriented Method
13Aspect-Oriented Software Development
OO Solution
Aspect-Oriented Solution
Crosscutting Concerns
Aspect
Join Points
Classes
- Improve separation of concerns
- Improve maintainability and reuse of classes and
crosscutting concerns - AspectJ and Hyper/J
14The Aspect-Oriented Method (I)
Aspect-Oriented Solution
OO Solution
C
Autonomy, Interaction, Adaptation, ...
A
I
- Improve separation of agency concerns
- Improve reuse and maintenance of MASs
15The Aspect-Oriented Method (II)
16The Experimental Setting
- Subjects (Experienced Programmers)
- 2 PhD Students x 2 PhD Students
- Almost 2 years
- January 2001 December 2002
- Training on Aspect-Oriented Software Development
- Code Standardization
- each design and code implemented the same
scenarios - different programming styles
17The Pattern-Oriented Solution
Mediator Pattern
Agent
Property
Plan
Strategy Pattern
Autonomy
Adaptation
Interaction
Interface Agent
ailability Plan
Searching Plan
Composite Pattern
Collaboration
Knowledge
Role Pattern
Collaboration Core
Collaboration Role
Collaborative Agent
Counter Proposal
Proposal
User Agent
Information Agent
Middle Agent
Editor
Caller
Answerer
Content Supplier
18The Aspect-Oriented Solution
Autonomy
Adaptation
Agent
Plan
Interaction
ailability Plan
Searching Plan
Collaboration
Interface Agent
Knowledge
User Agent
Information Agent
Middle Agent
Counter Proposal
Proposal
Editor
Caller
Content Supplier
Answerer
19Evaluation The Construction Viewpoint
- Some OO abstractions are useful to represent
concerns of reactive MASs - Classes agent types and knowledge
- Inheritance
- reuse of basic agent actions
- specialization hierarchy of agent types, role
hierarchies, plan hierarchy and action hierarchy - Both methods provided improved separation of
concerns - Complementary in certain contexts
20Evaluation The Construction Viewpoint
- Limitations of patterns
- Choosing the suitable patterns is time-consuming
- Combination of patterns is challenging
- Example The Role Pattern x The Mediator Pattern
- Explosion of classes to address MAS concerns
- Some concerns are not encapsulated as a single
pattern - Difficult to understand the association between
agency properties and specific agent types - Limitations of aspects
- The identification of the join points is not
trivial
21Limitations of the Pattern-Oriented Approach
22Evaluation Framework
- Evaluation Framework
- Focus Reusability and Maintainability
- Based on the Basilis GQM Methodology
- Definition of a Quality Model
- Definition of a Metrics Suite
- The Reuse and Evolution Scenarios
23The Quality Model and Metrics
24The Reuse and Evolution Scenarios
- S1) Change on the Agent Roles (Evolution)
- S2) Creation of an Agent Type (Evolution)
- S3) Reuse of the Agenthood Concern (Reuse)
- S4) Inclusion of Collaboration in an Agent Type
(Reuse and Evolution) - S5) Reuse of Roles (Reuse)
- S6) Creation of a new Agent Instance (Evolution)
- S7) Change of the Definition of Agenthood (Reuse
and Evolution)
25Results (I)
- The Aspect-Oriented Approach provided
- Better support for maintainability and
reusability - More concise MAS in terms of
- lines of code (LOC metric) 1231 x 1445
- system vocabulary (VS metric) 56 x 62
- component vocabulary (NOA metric) - use of
patterns - Less coupled components than the pattern-oriented
approach - CBC Metric - E.g. Editor role 18 x 23, Caller
role 19 x 25 - DIT Metric - Patterns abuse the inheritance
mechanism - high inheritance couplings
26Results (II)
- The Aspect-Oriented Approach provided
- Better support for separation of MAS concerns
- CDC, CDO, CDLOC
- Lack of cohesion in the aspects
- LCOM metric
- Some more complex operations
- WMC metric (complexity of the advices/pointcuts)
27Results (III)
The aspect-oriented approach required less
modification and extension of the selected MAS
28Ongoing Work
- Empirical and theoretical validation of the
proposed metrics - Investigation of MASs containing cognitive agents
- electronic marketplace (PUC-Rio)
- urban traffic management (USP - Sao Paulo)
- Investigation of MASs designed and implemented
outside of our group (SELMAS colleagues) - Facett An Aspect Language for Multi-Agent
Systems - Component language subset of TAO
- Facets support crosscutting concerns in MAS
design
29Results and Publications
- Qualitative Study
- The Aspect-Oriented Approach for Developing MASs
A. Garcia, V. Silva, C. Chavez, C. Lucena.
Engineering Multi-Agent Systems with Aspects and
Patterns. Journal of the Brazilian Computer
Society, Special Issue on Software Engineering
and Databases, August 2002.
?
A. Garcia, C Lucena, D. Cowan. Agents in
Object-Oriented Software Engineering. Software
Practice Experience, Elselvier, 2003. (Accepted
to Appear)
?
A. Garcia et al. Promoting Advanced Separation
of Concerns in Intra-Agent and Inter-Agent
Software Engineering. Workshop on ASoC at
OOPSLA'2001, Tampa Bay, USA, October 2001.
?
A. Garcia, V. Silva, C. Chavez, C. Lucena.
Engineering Multi-Agent Systems with Aspects and
Patterns. Journal of the Brazilian Computer
Society, Special Issue on Software Engineering
and Databases, August 2002.
?
30Results and Publications
- TAO The Conceptual Framework for Agent-Based
Software Engineering - Quantitative Studies
V. Silva, A. Garcia, A. Brandão, C. Chavez, C.
Lucena, P. Alencar. Taming Agents and Objects in
Software Engineering. In "Software Engineering
for Large-Scale Multi-Agent Systems".
Springer-Verlag, LNCS 2603, April 2003.
?
A. Garcia et al. Agents and Objects An
Empirical Study on the Design and Implementation
of MAS. In SELMAS03 Proceedings. May 2003.
(Accepted to Appear)
?
A. Garcia et al. Agents and Objects An
Empirical Study on Software Engineering. TR
06-03, PUC-Rio, Brazil, February 2003.
?
31Additional Contributions and Publications
- A System of Aspect-Oriented Patterns for MASs
- T-Rex A Reflective Architecture for Mobile
Agents - SELMAS02 and SELMAS03
O. Silva, A. Garcia, C. Lucena. The Reflective
Blackboard Architectural Pattern. In "Software
Engineering for Large-Scale Multi-Agent Systems".
Springer-Verlag, LNCS, March 2003. (Accepted to
Appear)
?
O. Silva, A. Garcia, C. Lucena. T-Rex A
Reflective Tuple Space Environment for
Dependable Mobile Agent Systems. Workshop on
Wireless Communication and Mobile Computation
(WCSF'2001), Recife, Brazil, August 2001.
?
A. Garcia, C. Lucena. Software Engineering for
Large-Scale Multi-Agent Systems SELMAS 2002.
(Post-Workshop Report) ACM Software Engineering
Notes, August 2002.
?
?
A. Garcia, C. Lucena, J. Castro, A. Omicini, F.
Zambonelli. Software Engineering for Large-Scale
Multi-Agent Systems. LNCS 2603, Springer, January
2003. (To be published)
32- Colocar mais referencias
- Usar sugestões dos revisores
- Dizer q outras pessoas conceberam o método
orientado a aspectos - Ler sobre variável dependente e independente.
- Trabalho em andamento
- Aspects in AOSE SPE
- The Facet Abstraction
- Crosscutting Concerns in AO Languages
- New Abstraction to TAO
- MAS of SELMAS02 colleagues Coordination,
Trustworthy, Fault Tolerance, Display - FacetTAO An Aspect-Oriented Language for AOSE
33SoCAgents Group
VMarket
SELMAS 2002, 2003
MAS Applications
CommercePipe
VGroups
Portalware
Metrics Quality Model
TAO Conceptual Framework
Empirical Studies
Modeling Language
T-Rex
Aspect-Oriented Approach
Methods
34Cooperations
SoC Agents
Metodologia Framework Conceitual
R
T-Rex
D
T
USP
Teste em SMAs
I
Aplicação Método
35Our Approach
- The 1st principle the objects are not aware of
the agency aspects added (obliviouness) - The 2nd principle with the separation of agent
services from their agency properties, reuse and
evolution is improved (quantification)
36Our Aspect-Oriented Approach (III)
- Roles modularized as aspects
CALLER
ANSWERER
SendSearchAsk() ReceiveResult()
ReceiveSearchAsk() SendResult()
ltltcrosscutsgtgt
ltltcrosscutsgtgt
ActivatesCaller()
InformationAgent
search(Keyword)
search(
KWList
)
37AspectJ
38 39Outline
Problems Research Questions Results Publications
!
- Motivation
- The Problem
- Goals
- Background
- Aspect-Oriented Software Development
- Design Patterns
- The Aspect-Oriented Method for MAS Development
- Empirical Studies
- My Doctoral Research A Roadmap
?
?
?
40The Problem (I)
- Objects x Agents
- state
- contains description of its behavior
- behavior
- autonomy, adaptation, interaction
- From agents to objects conceptual gaps
41Introdução
- Engenharia de Software Orientada a Agentes
- Agentes (Propriedades Internas)
- Estado crenças, objetivos, planos, ações
- Comportamento
- Autonomia
- Interação
- Adaptação
- Propriedades Externas
- Organizações
- Ambientes
- Mobilidade
- Colaboração (Papéis)
- Aprendizagem
42Software Engineering of MASs
- Intra-Agent Concerns
- Agent Types
- goals
- knowledge
- services
- Autonomy, Interaction, Adaptation
- Collaboration, Intelligence, Mobility
- Inter-Agent Concerns
- Roles and Organizations
- Coordination, Mobility, Context-Awareness,
Trustworthy...
Agenthood
Agenthood
43O Problema
Modelos do SMA
Propriedades Externas
Propriedades Internas
Fase de Especificação (orientada a agentes)
Como separar tais propriedades?
Método ad hoc
Fase de Desenvolvimento (orientada a objetos)
SoC?
44Data Collection
- Together Tool
- Manual Collection
- SoC Metrics
45O Problema
Modelos do SMA
Autonomia, colaboração, Adaptação...
Propriedades Internas
Várias Metodologias
Fase de Especificação (orientada a agentes)
Método ad hoc
Fase de Desenvolvimento (orientada a objetos)
? SoC ? Manutenção ? Reutilização
46Introdução
Modelos do SMA
Propriedades Externas
Propriedades Internas
Fase de Especificação (orientada a agentes)
Fase de Desenvolvimento (orientada a objetos)
47Games Simulation
- O que algumas pessoas acreditam e que ja
estamos implementando MASs, mas com the OO
notions at hand
Artificial, Simulated Environment
LARGE-SCALE SYSTEMS
E-commerce, E-learning, Information
filtering Virtual development environments...
Environment Web/Internet A Big ORB
Environment Web/Internet A Big ORB
48Solução e Objetivos
- Solução Método para Desenvolvimento de SMAs
- Objetivos
- Entender se o paradigma de objetos é adequado
para o desenvolvimento de SMAs - Objetos, métodos e atributos
- Herança, agregação, associação, delegação, ...
- Prover um método orientado a aspectos para o
desenvolvimento de SMAs
49- How this research advances the state of the art
of AOSE? Limitations of related work? - Contribute to a better understanding of the
interplay between agents and objects - how? Experimenting and analyzing the problems
- arguments are not based on empirical sources
- our philosophy/methodology is different lets to
look to working abstractions (such as OO,
patterns,) and find the real problems
underpinning the development of agents with
existing abstractions. - we think a good way to show the added value of
agents is showing how it goes from OO to agents,
50Background
- Software Engineering of MASs
- Abstractions in OO Software Engineering
- Using OO Abstractions for Developing MASs
51AOSE Researchers
- Methods and languages totally independently from
the object paradigm
52Past Experience with MAS Engineering
Concern1
Concern2
Empirical Results
Ongoing
- Of course, you can use OO to implement MAS, but
the question is - Is it provide support for
maintainable and reusable support? - If no,
why? - Of course, it does not provide evidence
that OO does not provide support for MAS - it
could be related to design decisions of the MAS
engineers - schedule restrictions - designers
have not maintainability and reusability in
mind... - The MAS concerns were lost across the
object-oriented design and implementation -
Hyphoteses 1) The OO abstractions are not able
to modularize naturally the MAS concerns 2) The
MAS designers need a principled method to guide
thestructuring of the MAS concerns in terms of
the OO abstractions
53Empirical Studies
VMarket
- Problems encountered
- lack of reuse of agency concerns across MAS
projects - prohibitive maintenance
- Possible causes
- poor separation of concerns
- lack of unified terminology
- object schizophrenia
MAS Applications
CommercePipe
VGroups
Portalware
Avestruz
54Validação (Estudos Empíricos)
- Fatores Reusabilidade e Facilidade de Manutenção
- Método Orientado a Padrões OO (mediator, role,
observer...) - Estudo Qualitativo (1a. Fase)
- Elaboração de cenários
- Dificuldade de reutilização
- Dificuldade de manutenção
- Estudo Quantitativo (2a. Fase)
- Uso do método GQM
- Definição de um conjunto de métricas
- Redefinição de métricas clássicas (coesão,
acoplamento, tamanho...) - Criação de métricas para SoC
55Resultados (1a. Fase)
- Solução OO baseada em padrões
- Escolha do padrão apropriado é problemática
- Vários padrões para o mesmo problema em SMA
(mediator, chain of responsibility...) - Combinação de múltiplos padrões não é trivial
- Padrão Role x Padrão Mediator
- Abuso de herança
- Explosão de classes
- Object Schizophrenia
- Adaptações intrusivas (reutilização e manutenção)
- Objetos, herança, agregação, ..., padrões não
fornecem suporte a SMAs reutilizáveis e fáceis de
manter
56Resultados (1a. Fase)
- Solução proposta
- Benefícios
- Melhor SoC
- Suporte para Reutilização e Manutenção
- Dificuldades
- Papéis x planos
- Descoberta dos aspectos (específicos de
aplicação) nem sempre são fáceis - Ainda precisávamos melhorar nosso entendimento
sobre os métodos e SMAs e SOOs - Estudo Quantitativo (em desenvolvimento)
- Outros projetos (Marketplace)
- Projetos SMA fora do TecCoom (SELMAS02 workshop)
57Conclusions
- Based on the research results, what is the new
thing to say - independently from the use of patterns or not, OO
abstractions do not fit very well with agency
properties - the aspect-oriented approach is generally
better...
58Motivation (III)
- Software Engineering and Programming A
Historical Perspective
Object
- O que algumas pessoas acreditam e que ja
estamos implementando MASs, mas com the OO
notions at hand
59An Example Portalware
- Agenthood Properties
- Autonomy
- An agent is capable of acting without direct
external intervention - It has its own control thread and can accept or
refuse a request message - Interaction
- An agent communicates with the environment and
other agents by means of sensors and effectors - Adaptation
- an agent adapts/modifies its mental state
according to messages received from the
environment
60An Example Portalware
- Additional Properties
- Collaboration
- cooperation and/or negotiation with other agents
- Learning
- an agent can learn based on previous experience
while reacting and interacting with its external
environment - Mobility
- an agent is able to transport itself from one
environment to another
61Motivation (II)
- Abstractions are used to isolate concerns
- UML Abstractions
- Class, object, method, attribute, specialization
- Additional Design Abstractions
- Design patterns Gamma, 95
- Java Abstractions
- Class, object, method, attribute, inheritance
- Method call, interface, ...
62Looking at Existing MASs
- How agency concerns are structured based on OO
abstractions? - TecComm Lab
- Portalware, MAS Framework, Avestruz, VMarket,
CommercePipe - What are software engineering concerns to MAS
developers? - 3 viewpoints Construction, Reuse, Maintenance
63The Construction Viewpoint
- Agency Concerns
- Agent Types
- goals
- knowledge
- actions
- Autonomy, Interaction, Adaptation
- Collaboration, Learning, Mobility
- Roles and Organizations
- Coordination, Mobility, Context-Awareness,
Trustworthy...
Agenthood
Agenthood
64The Construction Viewpoint
- Definition of Agent Types
- services, goals and knowledge
- Definition of the Agenthood Properties
- Agenthood and other Properties
- structure the property strategies and algorithms
- associate agent types with properties
- associate properties with agent services and
knowledge - compose the properties
- Definition of Roles
- attach the roles with agent types
- Organizations, Environments
65Maintenance and Reuse Viewpoint
- Change the number of agent types
- Change agent services
- Change algorithms related to agent properties
- degree of autonomy
- learning technique
- Addition of agent roles in different contexts
- Reuse agent types
- Reuse agent services
- Reuse algorithms related to agent properties
- Reuse agent roles in different contexts
66Agents x Objects Poor Understanding
- Several agent-oriented languages and methods
- Several OO implementation frameworks for MASs
- T-Rex, JADE, Retsina, JAFIMA, ZEUS,
- Few software engineering approaches to support
agents in OO design and implementation - A set of design patterns Kendall, 1999
67Agents x Objects Poor Understanding
- Several agent-oriented languages and methods
- GAIA, Common-KADS, Tropos, MAS-ML, ...
- Several OO implementation frameworks for MASs
- T-Rex, JADE, Retsina, JAFIMA, ZEUS,
- Few software engineering approaches to support
agents in OO design and implementation - A set of design patterns Kendall, 1999
68Using Patterns for Developing MASs
- Based on solutions (patterns) documented in the
literature - Kendalls Patterns Kendall, 99
- Encapsulates the interaction concern
- Uses sensors and effectors (change the sensors)
- Mediator Pattern
- Modularizes each agency behavioral property
- interaction, adaptation, autonomy,
collaboration... - Mediate the use of these properties
- Role Pattern
- Decouples the agent services from the agent roles
- Encapsulates the collaboration concern
69The Aspect-Oriented Approach
- Separation of Concerns
- Aspects (and classes) encapsulate the agency
concerns of interest - Reusability
- Reuse of Aspects and Classes
- Maintainability
- Obliviousness
- Quantification
70Aspects and AspectJ
- Aspects concerns that crosscut system components
- Examples logging, distribution, exception
handling, and so on... - Several approaches AOP, MDSoC, Composition
Filters, ... - Abstractions in AOSD
- Components Classes and Aspects
- AspectJ e Hyper/J
71Past Experience with MAS Engineering (II)
72Goals, Questions Metrics (GQM)
How well are the agency concerns localized?
How high is the coupling between system
components?
Components classes or aspects Operations
methods or advices
73The Aspect-Oriented Method (III)
Sensor
AUTONOMY
Introduction Part
ControlThreads HowManyThreads()
Effector
MakesDecision() StartsThreadControl() PerformsPlan
()
ADAPTATION
INTERACTION
ltltcrosscutsgtgt
SuspendedPlans GetNextPlan()
Inbox Outbox ReceiveMsg() SendMsg()
Agent
AdaptBeliefs() AdaptGoal() AdaptPlan ()
ltltcrosscutsgtgt
ltltcrosscutsgtgt
BeliefList
GoalList
PlanList
Receive() Send()
updateBelief()
addGoal()
setGoal()
addPlan()
Advices Part
setPlan()
74The Aspect-Oriented Method (IV)
- Improved support for MAS maintenance and evolution
75The Pattern-Oriented Method (I)
- Separation of Concerns
- Patterns encapsulate the MAS concerns of interest
- Improve the design vocabulary
- Reusability
- Reuse of the pattern and its solution elements
- Maintainability
- Planning for Change
76The Investigated Methods
- The methods are concerned with concerns
independently of - implementation architecture JADE, JAFIMA,
RETSINA, ZEUS, IBM AGLETS - communication language KQML, ACL...
- ontology description DAMLOIL, SHOE...
77Ongoing Work
- Investigation of MASs containing cognitive agents
- electronic marketplace (PUC-Rio)
- urban traffic management (USP - Sao Paulo)
- Investigation of MASs designed and implemented
outside of our group (SELMAS colleagues)
78The Metrics