Article 1
Article 1
Online at http://www.jot.fm. Published by ETH Zurich, Chair of Software Engineering ©JOT, 2007
Abstract
Design patterns represent solutions to specific problem of developing one application
that have evolved over time. They leverage the reuse level to the design phase by
providing a common vocabulary of design, means of understanding designs and proven
building blocks from which more complex applications are built. Much of the research
work on design patterns in agent world has primarily focused on discovering and
documenting patterns. To reap the benefits of deploying these proven design solutions,
patterns should be used as a first-class modelling blocks in designing the agent
application. This paper proposes a conceptual model based on patterns and agent
abstraction.
1 INTRODUCTION
2 MOTIVATION
The multi-agent paradigm has shown an increasing potential for modelling and building a
wide range of complex applications from various domains. Multi-agent systems used for
air traffic control, weather monitoring and air combat simulations are some typical
examples. Designing and developing multi-agent system is not easy [Sycara98]. One
must manage at least three different levels of abstraction at the same time:
• The level of the individual agents.
• The level of the interactions between the agents
• The level of their organization
With increases in the complexity of software systems, reusing design ideas and models in
terms of design patterns is a promising alternative than designing from scratch. Looking
at the literature on design patterns for the agent world, we realize that most of the effort is
expended in discovering and documenting design patterns. The documentation of design
patterns, as it stands, describes details about a pattern, its usage, structure, behaviour of
participants, forces and consequences, and guidelines for implementations. Little work is
concerned with systematically applying these reusable designs in developing new multi-
agent applications. A systematic approach to design with patterns goes beyond just
applying a certain pattern. The approach include a development process which defines a
pattern composition approach, analysis and design steps, design models and tools to
automate the development steps [Yacoub&Ammar04].
This paper discuss the relationship between concepts used in Pattern –Oriented
Design for agent world modeling (POD) and the agent metamodels. The POD semantics
is defined along two dimensions: abstract syntax and well-formedness rules. According to
Kim and Carrington [Kim&Carrington04], a pattern properties must be expressed
generically so that the pattern can be realized in various ways depending on the
Figure 3 illustrates the mapping between the proposed POD concept to the simplified
version of the unified agent concept proposed by [Bernon et al.04]. The unified agent
concept is resulted from the integration of three agent design methodologies: ADELFE,
PASSI and Gaia. It represents the common concepts shared by the three methodologies.
In mapping the POD concept to the unified agent concept, we represent it in two level of
abstractions: pattern level and agent level. The pattern level deals with the agent patterns
classes available in the literature: agent structure, agent interaction, agent organization
and agent architecture. The agent level contains the elements of the agent-based solution.
In this level, the agent is enriched with all the generic properties an agent may have. The
agent is composed of role, service and ontology. The agent can belong to an organization.
By mapping these two concepts, we would be able to define a methodology to
systematically design multi-agent application with patterns. The motivation is the
methodology could be immersed to the existing agent design methodologies to make
them more mature.
In this section, we present a formal definition of POD concept using Object-Z. Object-Z
is an object-oriented extension to Z designed specifically to facilitate specification in an
object-oriented style and it is used as a meta-language to specify other languages such as
UML [Kim&Carrington99]. The model constructs discussed in this section are useful for
tool developers and methodologists who are more interested in the formal aspects of the
models and their semantics.
[PatternName, Name]
Using this type, we formalize the metaclass Pattern in Figure 2 as an Object-Z class
Pattern. The attribute patterninstance is formalized as a variable in the Object-Z class.
Agent Class
In POD, agent class is defined as a descriptor of a set of roles with common properties in
terms of tasks and structure. The agent class has a name, roles, attributes and tasks.
Attributes have names and types. Following the approach of Kim and Carrington
[Kim&Carrington99], two given sets, AgentName and Name are defined for the agent
structure. From these given sets, the name of all agent classes and the names of all
attributes, tasks and roles can be drawn respectively. A schema named AgentClassDecl
denotes the components of an agent class: a finite set of attributes, a finite set of roles and
a finite set of tasks played by the roles. A partial function attrstate is declared to map
attributes to their types. Agent class names should be unique in the enclosing name space.
Thus, the set of agent classes defined as a partial function from AgentClassName to
AgentClassDecl.
[AgentName, Name]
A schema named AgentRole denotes the component of an agent role: an association to the
agent class, a finite set of role name and a partial function, plays to map the agent class to
roles it plays.
The constraints defined for the AgentRole are based on the constraints defined by
Zambonelli [Zambonelli et al.01]:
1. No agent can simultaneously play more than one role.
2. Every agent that plays role r1 must play at least one other role.
3. Every agent that plays role r1 will eventually play role r2.
4. Once an agent plays role r1, it plays r1 forever.
Pattern Association
A pattern association defines a semantic relationship between the interfaces of two
patterns. It has exactly two AssociationEnd. Each end is a pattern interface, which refers
to services offered by the agent.
assockind ::= none | aggregate | composite
patassockind ::= service
Pattern Dependency
A pattern dependency indicates a semantic relationship between two patterns – a situation
in which a change to the source pattern may require a change to the target pattern. This
type of relationship is used in POD at the high-level design phase where the system is
modeled as a composition of design patterns and PatternDependency relationship
between those patterns.
Pattern Interfaces
A pattern interface is a set of classes used to define how the pattern interfaces to other
patterns. In our approach, the set of classes refer to the set of services offered by the
Agent Organization
A pattern for agent organization used in POD is reused from the existing catalogues of
organisation patterns for object-oriented systems. As pointed by Zambonelli [Zambonelli
et al.01], there are similarities between agent organization in multi-agent system with
respect to the most widely used organisational structures. In defining rules for the agent
organization, we need to express constraints between agent roles, between agent
interactions and between agent roles and its interaction. Hence, in one organization, there
should exist an interaction that involves one agent role, r1 and another agent role, r2.
Agent Interaction
A multi-agent system consists of an organized group of agents which interact with each
other. This interaction is generally regarded as the foundation for cooperative and
competitive behaviour in autonomous agents. In POD, an agent interaction should
consists at least the following elements:
• Type of participants
• Interaction states
• Events which trigger states changes
• Valid actions given the participant and the state.
Prior to formalizing the agent interaction concept, a given set, State is defined, from
which the names of all states are drawn. A schema named Transition denotes the
components of a transition in one interaction: a source and target state, a guard
expression, events which trigger the transition and actions taken due to the transition.
[State]
Operations used in an event are defined as follows. The attributes name and a sequence of
operation parameter are formalized as variables in the Operation class.
Agent Architecture
Prior to formalizing an agent architecture pattern, two given sets, PORT and
COMPDESC are defined for the agent architecture. As outlined by Abowd [Abowd et
al.95], an architecture style consists of components (the locus of computation),
connectors (define the interaction between components) and configuration (the
collections of interacting components and connectors). In applying this concept to the
agent world, an architectural component consists of component name, ports together with
a description of its computation. This is represented in an Object-Z schema named
Component. An architectural connector is then modeled as a collection of agent roles and
a description of its interaction protocol. This is represented in a schema named
Connector.
[PORT, COMPDESC]
6 PATTERN MODELS
This paper develops a precise design patterns model for agent world by directly
instantiating the Object-Z specifications defined in the pattern metamodel. An example is
given in the following sub-section. Any conformance checks on the pattern model can be
achieved using reasoning techniques developed for Object-Z on the Object-Z
specification.
[State, Interface]
2. The subject object will notify all the observers objects attached to it when its
subject’s state changes. The subject class will invoke the update operation of each
observer to inform those observers of the subject’s state change.
3. Concrete Subject class inherits from the Subject class.
4. Concrete Observer class inherits from the Observer class.
5. Observer objects are registered and associated with subjects. Each subject, then,
has a registered set of observers.
6. Each observer is associated with only one subject.
7 RELATED WORKS
Several successful experiences have reported on the advantages of using design patterns
in designing agent applications. Generally, we classify design approach that utilize design
patterns into adhoc and systematic approach. Using an adhoc approach, a design pattern
records a solution and forces and consequences of applying this solution. Kolp [Kolp et
al.01] presents a set of social patterns as part of the Tropos [Bresciani et al.04]
methodology to describe the general architecture of a system under construction.
Cossentino [Cossentino et al. 03] presents the design of a particular type of agent pattern
immersed in the PASSI methodology. They defined a pattern as consisting of a model
and an implementation code. However, this is not usually sufficient to systematically
develop applications using patterns. This is simply because there is no process to guide
the development and to integrate the pattern with other design artifacts.
A systematic approach to design with patterns goes further beyond just applying a
certain pattern. Systematic approaches can be classified as pattern languages and
development processes. A pattern language provides a set of patterns that solve problems
in a specific domain. Pattern languages not only document the patterns themselves but
also the relationships between these patterns. They imply the process to apply the
language to completely solve a specific set of design problems. Weiss [Weiss03]
proposed a generic agent pattern language. It documents the forces involved in agent-
based design and key agent concepts. A domain-specific pattern language for agent-based
manufacturing has been proposed by [Weiss03]. The relationships between the patterns
are made explicit in such a way that they guide a developer through the process of
designing a system. A systematic development process, on the other hand, defines a
pattern composition approach, analysis and design steps, design models, and tools to
automate the development steps. Such development process produces consistent designs
each time the process steps are conducted. This paper is concerned with systematic
development processes because they are the way to repeatable software design practice.
The concept presented in this paper is an initial step to define a methodology to
systematically design agent applications using patterns.
Overall, our work is inspired by the component-based approaches. Specifying the design
patterns as design components allows for pattern composition and integration at design
level. The syntactic structures are precisely described using the Object-Z notation. This
description is then used as a basis for translation rules from POD contructs to Object-Z
constructs. The Object-Z specifications are formal models of pattern diagrams. Thus,
semantic analysis of these pattern diagrams can take place on these Object-Z
specifications using proof techniques provided for Object-Z. Any inconsistency or error
discovered during the analysis provide feedback on the pattern diagrams. The Object-Z
specifications introduced in this paper are type-checked using the Wizard type-checker.
The formal approach presented in this paper, brings precision to POD descriptions
by eliminating ambiguities from the description. The formal pattern metamodel and
models facilitate a rigorous reasoning about patterns as design components. After
identifying the concept for the systematic agent development using patterns, we are now
working on defining a methodology for designing multi-agent systems according to the
proposed metamodel. The aim is, the methodology could be applied or embedded to the
existing agent methodology. The motivation is to make the existing agent design
methodology like Tropos [Bresciani04], MaSE [DeLoach et al.01], Gaia [Zambonelli et
al.03] and PASSI [Cossentino03] more mature.
REFERENCES
[Aridor&Lange98] Aridor Y. and Lange D.: “Agent Design Patterns: Elements of
Agent Application Design”, in Autonomous Agents (Agents ’98),
ACM Press, 1998.
[Abowd et al.95] Abowd G., Allen R. and Garlan D.: “Formalizing Style to
Understand of Software Architecture”, ACM Transaction of
Software Engineering Methodology, Volume 4, Number 4, 1995,
pp. 319-364.
[Bresciani et al. 04] Bresciani, P., Giorgini, P., Giunchiglia, F., Mylopoulos, J and
Perini, A.: “TROPOS: An Agent-Oriented Software Development
Methodology” in Journal of Autonomous Agents and Multi-Agent
Systems, Kluwer Academic Publishers Volume 8, Issue 3, Pages
203 - 236, May 2004.
[Cossentino et al. 03] Cossentino, M., Sabatucci, L, Sorace, S. and Chella, A,: “Patterns
reuse in the PASSI methodology”, Fourth International Workshop
Engineering Societies in the Agents World (ESAW'03) - 29-31
October 2003, Imperial College London.
[DeLoach et al. 01] DeLoach, S. A., Wood, M. F. and Sparkman, C. H.: “Multiagent
Systems Engineering”, The International Journal of Software
Engineering and Knowledge Engineering, Volume 11 no. 3, pp.
231-258, June 2001.
[Deugo et al. 01] Deugo, D., Weiss, M. and Kendall, E.: Coordination of
Autonomous Internet Agents: Models, Technologies and
Applications, chapter Reusable Patterns for Agent Coordination,
Springer, 2001.
[Gamma et al. 95] Gamma, E., Helm, R., Johnson, R. and Vlissides, J.: Design
Patterns, Elements of Reusable Object-Oriented Software.
Addison-Wesley, Longman, 1995.
[Kim&Carrington99] Kim, S. K and Carrington, D.: Formalizing the UML Class
Diagram Using Object-Z, in the Proceedings of the 2nd.
International Conference on the Unified Modeling Language
(UML’ 99), vol. 1723 of Lecture Notes in Computer Science,
Springer, 1999
[Kim&Carrington04] Kim, S. K. and Carrington, D.: Using Integrated Metamodeling to
Define OO Design Patterns with Object-Z and UML, in the
Proceedings of the 11th. Asia-Pacific Software Engineering
Conference (APSEC’04), 2004.
[Kolp et al.01] Kolp, M., Castro, J. and Mylopoulos, J.: “A social organization
perspective on software architectures”, in 1st. International
Workshop from Software Requirements to Architectures, 2001.
[Lind03] Lind, J.: “Pattens in Agent-Oriented Software Engineering”. in
Giunchiglia, F., Odell, J. and Weiss, G., editors, Agent-Oriented
Software Engineering III, vol. 2585 of Lecture Notes in Computer
Science, Springer, 2003.
[Sauvage04] Sauvage, S. Design Patterns for Multiagent Systems Design. In
MICAI’04, in Lecture Notes in Computer Science, Volume 2972,
pages 352–361, Mexico, April 2004. Springer-Verlag, Heidelberg.
[Sycara98] Sycara K.: “Multiagent Systems”, AI Magazine 19(2), 1998, pp.
79-92.
[Szyperski98] Szyperski, C.: Component Software: Beyond Object-Oriented
Programming. Addison Wesley Longman, Reading, Mass, 1998
[Weiss03] Weiss M.: “A Pattern Language for Motivating the Use of
Agents”, (P.Giogini et al. (Eds.): AOIS 2003, LNAI 3030, pp. 142-
157, 2004).