In
order to have a process that starting from the model of a pattern can generate
its multi-platform implementations, we adopt several intermediate representation as shown in fig. 5. Starting from the UML
description we obtain the XML meta-pattern (that is platform independent); from
this, applying an XSLT transformation, we deduct the platform (FIPA-OS or JADE)
specific pattern. With another transformation that introduces some of the
implementation features of the platform we construct the JAVA skeleton. At this
skeleton we add the body of the methods (when available for the specific
environment) obtaining a class that is complete both in the structure and in
the inner code.
Fig. 1
More in details we can note
that each pattern is represented at design level with two different kind of
diagrams (structural and behavioral). In fig. 6 we
can see the design representation of the pattern. This allows (together with a
complete textual documentation including the goal addressed by the pattern) to
the designer the choice of the correct element he could need. Now we will
discuss the process that starting from this model brings to the code of the
agents in the different implementation environments.
Fig. 2
As already discussed, in
our work we refer to FIPA-compliant platforms and specifically to the FIPA-OS
and Jade frameworks. As both of them present agent structures as classes
containing attributes, methods and inner-classes, we thought to adopt a
hierarchical meta-language to describe the agent and his properties. The
hierarchy’s root level entity is the agent, which contains inherent properties
such as attributes, methods and tasks (the inner classes). We have chosen XML
as our meta-language as it is oriented to tree data structure representations.
It proved very useful for managing agents and tasks. As a matter of fact, this
allowed us to easily manipulate their structure and add, edit or delete agents’
properties very easily. This is the key point in the application of a pattern
to an existing agent in terms of skills and behaviors.
We believe that the use of a meta-language can give us a straight way to create
and maintain a repository of patterns. Moreover, agents’ source code can be
automatically generated from meta-language representation without any manual
support.
The choice of XML is also
valid in the context of the Agent Factory Project that we are carrying on and
that has been funded by the AgentCities.NET initiative. As a matter of fact,
because of the XML easy portability, agents’ patterns will be shared in a web
server, so that designers of the Agentcities
community will be able to access and update them.