E-commerce using an agent oriented approach

10
AAAAAAA ´ IAAA AAAAAAA ´ IAAA ART ´ ICULO E-commerce using an agent oriented approach Suna Alexandru, Lemaitre Christian, El Fallah Seghrouchni Amal LIP6 - CNRS UMR 7606 University of Paris 6 8, Rue du Capitaine Scott 75014, Paris {Alexandru.Suna, Amal.Elfallah}@lip6.fr Abstract Electronic commerce is a domain continually evolving. However, the potential of the commerce on the Internet is far from being completely exploited today. There are many elements that could be easily automated and endowed with intelligence, especially using agents. This paper presents the process of developing an e- commerce application modelling the coffee market in Veracruz, Mexico, using intelligent and mobile agents implemented in the CLAIM agent-oriented programming language and deployed on the SyMPA platform. Keywords: Multi-agent systems, e-commerce, agent-oriented programming, mobility. 1. Motivations Electronic commerce (e-commerce) is one of the most important aspects of the Internet to emerge nowadays. It allows people and companies to ex- change services and goods with no limits of time or distance. At a simplistic glance, the main ac- tors are the buyers who want to purchase goods or services, the sellers who offer them and the pro- ducers who create them. A producer is always a seller as well. The e-commerce contains all these actors and other additional important elements (e.g. secure payment) in the Internet context. The e-commerce is a domain continually evolv- ing during the last years. Statistics show that the business amount of the world-wide e-commerce evolved from 60 billions dollars in 2000 to 250 billions dollars in 2003 and was expected to reach in 2004 an amount of 430 billions dollars. Every- thing can be bought today on the Internet, but the most sold range of products are the comput- er products (hardware, software or accessories), books, documents, financial services, electronics, travel services, etc. In the context of the electronic commerce, an im- portant role is played by the Web Services 1 . They propose a credible support allowing applications to expose their functionalities using standard in- terfaces, favoring a service-oriented architecture composed of complex, distributed and coopera- tive heterogeneous systems. However, even with Web Services, the e- commerce is still lacking the flexibility of human based traditional commerce. The reason for this is that no actor able to take knowledge based de- cisions is used in the electronic value chain. It is clear that the next generation of e-commerce would need to deal with the flexibility issue. The most promising technology to deal with this is the intelligent agent technology. The main ele- ments of an intelligent agent useful in this context are the cognitive components (e.g. beliefs, goals, plans) and his ability to interact with other agents allowing a powerful autonomous reasoning. An- other additional useful feature of agents for e- 1 http://www.w3.org/2002/ws/ Inteligencia Artificial, Revista Iberoamericana de Inteligen cia Artificial. No.25 (2005), pp. 89-98. ISSN: 1137-3601. © AEPIA (http://www.aepia.dsic.upv.es/).

Transcript of E-commerce using an agent oriented approach

AAAAAAAIAAAAAAAAAAIAAAARTICULO

E-commerce using an agent oriented approach

Suna Alexandru, Lemaitre Christian, El Fallah Seghrouchni Amal

LIP6 - CNRS UMR 7606 University of Paris 68, Rue du Capitaine Scott

75014, Paris{Alexandru.Suna, Amal.Elfallah}@lip6.fr

Abstract

Electronic commerce is a domain continually evolving. However, the potential of the commerce on the Internetis far from being completely exploited today. There are many elements that could be easily automated andendowed with intelligence, especially using agents. This paper presents the process of developing an e-commerce application modelling the coffee market in Veracruz, Mexico, using intelligent and mobile agentsimplemented in the CLAIM agent-oriented programming language and deployed on the SyMPA platform.

Keywords: Multi-agent systems, e-commerce, agent-oriented programming, mobility.

1. Motivations

Electronic commerce (e-commerce) is one of themost important aspects of the Internet to emergenowadays. It allows people and companies to ex-change services and goods with no limits of timeor distance. At a simplistic glance, the main ac-tors are the buyers who want to purchase goods orservices, the sellers who offer them and the pro-ducers who create them. A producer is always aseller as well. The e-commerce contains all theseactors and other additional important elements(e.g. secure payment) in the Internet context.The e-commerce is a domain continually evolv-ing during the last years. Statistics show that thebusiness amount of the world-wide e-commerceevolved from 60 billions dollars in 2000 to 250billions dollars in 2003 and was expected to reachin 2004 an amount of 430 billions dollars. Every-thing can be bought today on the Internet, butthe most sold range of products are the comput-er products (hardware, software or accessories),books, documents, financial services, electronics,

travel services, etc.In the context of the electronic commerce, an im-portant role is played by the Web Services 1. Theypropose a credible support allowing applicationsto expose their functionalities using standard in-terfaces, favoring a service-oriented architecturecomposed of complex, distributed and coopera-tive heterogeneous systems.

However, even with Web Services, the e-commerce is still lacking the flexibility of humanbased traditional commerce. The reason for thisis that no actor able to take knowledge based de-cisions is used in the electronic value chain. Itis clear that the next generation of e-commercewould need to deal with the flexibility issue. Themost promising technology to deal with this isthe intelligent agent technology. The main ele-ments of an intelligent agent useful in this contextare the cognitive components (e.g. beliefs, goals,plans) and his ability to interact with other agentsallowing a powerful autonomous reasoning. An-other additional useful feature of agents for e-

1http://www.w3.org/2002/ws/

Inteligencia Artificial, Revista Iberoamericana de Inteligen cia Artificial. No.25 (2005), pp. 89-98. ISSN: 1137-3601. © AEPIA (http://www.aepia.dsic.upv.es/).

2 Inteligencia Artificial Vol. 9, No 25, 2005

commerce applications is the mobility (e.g. agentscan move through the Internet to collect informa-tion about products or prices), in order to supportthe geographic distribution of complex systems,their computation over the net and to reduce thebandwidth and the data traffic [22]. Therefore weclaim that intelligent and mobile agents are ex-tremely useful for designing e-commerce applica-tions.

1.1. Why an agent-oriented pro-gramming approach

Unfortunately, while the main focus of the multi-agent systems (MAS) community has been onthe development of informal and formal tools forMAS engineering, concepts or techniques, the de-sign of declarative languages and tools which caneffectively support MAS programming remainedat an embryonic stage. Therefore, we argue thatfor a successful use of MAS paradigm, specif-ic high-level programming languages are needed.With this objective in mind we have proposedan agent oriented programming (AOP) languagecalled CLAIM [11] that helps the designer to re-duce the gap between the design and the imple-mentation phases (i.e. the designer should thinkand implement in the same paradigm, namelythrough agents), allows the representation of in-telligent elements (e.g. knowledge, beliefs, goals,reasoning) and meets the requirements of mo-bile computation. In addition, the CLAIM agentscan invoke methods implemented using other pro-gramming language (e.g. Java) and can invokeWeb Services. We consider that there is a dif-ference of abstraction between agents and ob-jects and consequently between CLAIM and Java(even if the agents will do most of the compu-tation using Java and the underlying platformis implemented in Java). The language’s opera-tional semantics [12] should allow the verificationof the built multi-agent systems. The language issupported by a distributed platform called SyM-PA [26] that offers all the necessary mechanismsfor agents’ management, communication, mobili-ty, security and fault tolerance.

2. Context

In this section we present the developed e-commerce application, the steps and the choic-

es made during the design phase. This applica-tion was developed in the context of a French-Mexican collaboration project 2. The coffee pro-ducers in Veracruz are usually small, with a re-duced financial power, but their number is im-portant. In 2001 they created together with thegovernment of the Veracruz state the ConsejoRegulador del Cafe Veracruz (The Veracruz Cof-fee Regulator Council - CRCV) whose role is toverify the coffee producers’ facilities that satis-fy specific norms of the origin denomination of“Cafe-Veracruz” and to certificate the lots of cof-fee reaching the quality stated by the norm. Themain objective of this strategy is to reach a newemerging specialty coffee market where the pricesof quality coffee attain prices several time higherthat the stock exchange prices for coffee. In 1999,the first e-auction for specialty coffee took place inBrazil. Since then, several coffee buyers and con-sumer associations decided to work on differente-commerce applications for specialty coffee mar-kets. In this context we propose an agent-basedapplication able to deal with the different typesof transaction negotiations and covering the en-tire value chain of coffee. We claim that our modelcan easily be applied to other domains.

2.1. Identify the actors

A first step toward the final application is to iden-tify all the actors involved in the considered sce-nario, their functionalities, interactions and allthe delicate issues, independent of any implemen-tation aspect.

First of all, we have the Coffee Producer. The cer-tification of his coffee is done by the CRCV pre-sented above. In the real environment, belongingto the CRCV is the Coffee Verifier that physi-cally goes to the producer’s facilities and verifiesthe quality of the production chain and of the fi-nal product and identifies the best coffee lots. Infunction of his appreciation, the CRCV emits cer-tificates for the producer’s coffee facilities lots andfor the green coffee. Another actor is the Marketwhere the producers “publish” their offers in or-der to be found by the interested Buyers. A buy-er searches specific types of coffee on the market.It is actually the market that matches the coffeeoffers and the buyers’ requests. When a buyer’sdemand corresponds to a producer’s offer, a di-rect interaction between them begins. One of themain issues in commerce in general and specially

2Lafmi = French-Mexican Informatics Laboratory, http://lafmi.imag.fr

Inteligencia Artificial Vol. 9, No 25, 2005 3

in e-commerce is the trustfulness of the players.The buyer must be convinced that the seller hasthe right certificates and the seller needs to besure that the buyer corresponds to a known com-pany and has the financial disposability. To dothat, he asks for a letter of credit from the buy-er’s Bank (another actor). As soon as these re-quirements are satisfied, the producer must finda Transport company and an Insurance servicefor the transported goods. After the successfularrival of the goods at the destination, the buy-er’s bank is notified in order to send the moneytransfer to the producer’s bank and to send thecustoms documentation to the buyer. This lastphase is a delicate one and requires very preciseand synchronized protocol.

This scenario gives a general view of the cof-fee market commerce in Veracruz. Additional el-ements can be added to this basic model. Aninteresting extension, that is naturally achievedusing intelligent agents, is the producers’ coop-eration. Taken individually, a producer may nothave enough financial power, but together withother producers he can form stronger groups forsharing a better technical infrastructure, cover-ing a larger fragment of the market, answeringto a greater number of client requests or sharingmeans of conveyance. Joining their efforts, theycan reduce their costs and increase their benefits.Interesting cooperation protocols can be analyzedin practice and programmed using agents.Another extension can be done using the advan-tages of the mobile agents. For instance, the buy-ers can send mobile agents to other buyers in or-der to locally analyze their data about differentproducers (e.g. the satisfaction level, the fairnessof the quality-price ratio, etc.). Mobile agents canalso be used by producers to gather data fromother producers about the buyers’ history.

2.2. Modelling the actors

Once all the actors of the application and theirinteractions are identified, the next step is tomodel them. For this stage we have adoptedthe methodology presented in [20]. Neverthe-less, any other design methodology, appropriatefor the developed application, can be used (e.g.AALAADIN [13]).

Even if we are using a multi-agent approach, itmay not always be the best solution to representall the actors as agents. In function of the in-telligence, autonomy and mobility level of each

actor, one must carefully decide if it should berepresented as an agent (either mobile or station-ary), as an independent application running ona site, as a Web page (dynamic or not) or as aWeb Service (accessed through a special agent ordirectly). We do not propose a general rule fordetermining the chosen representation of an en-tity, but the designer’s common sense and expe-rience should make this choice adequate. We willconsider below each actor and justify the chosenrepresentation.

The CRCV answers to producers’ requests forcertification. He sends verifiers to their sites andhe manages and interprets the gathered observa-tions. He also answers the buyers’ questions aboutthe quality of the coffee of different producers.Therefore we represent CRCV as an intelligentstationary agent.

A Coffee Verifier agent is more difficult to rep-resent as a software entity. In our application, averifier is a mobile agent created by CRCV whena request for certification arrives. He migrates tothe producers and give qualitative appreciationsin function of the data received from them. Thischoice can be motivated by security reasons. Theproducers may not want to send important andprivate date over the network but they accept ver-ifiers on their site. Being the only mobile agentin our application, he also illustrates how mobileagents can be used in the language.

The Producers ask for certification at CRCV,send their coffee offers to the market, interactwith the buyers, with the bank, must hire a trans-port company and must insure the transportedgoods. They may also use cooperation protocolsfor creating coalitions of producers or may createmobile agents for verifying the buyers’ history. Soit is clear that a producer will be an agent withpowerful intelligence and reasoning abilities.

A Buyer looks for certain types of coffee andsends requests to the market. After receivingmatching offers of producers, he verifies the cer-tification of the chosen one at CRCV, negoti-ates with him and receives the notification ofthe goods’ arrival. We can also endow the buy-ers with capacity to create mobile agents thatmigrate in order to check the satisfaction levelof other clients. Consequently, they will be repre-sented as agents.

The Market is acting mainly as a mediator be-tween the producers’ offers and the buyers’ re-quests. When a new offer arrives, the market will

4 Inteligencia Artificial Vol. 9, No 25, 2005

find and send to the corresponding producer alist of interested buyers. On the other side, whena client sends a request, the market will send himthe list of corresponding producers. The marketcan be represented as a Web Service or as anagent. Since we intend to endow him with intelli-gent capabilities, he is represented as an agent.

When an agreement is reached between a buyerand a producer for a coffee order, the producermust contact a Transport company for deliver-ing the coffee and an Insurance company for in-suring the transport. As the main role of theseactors is to answer requests concerning the priceof their services, we will represent them as WebServices.

Finally, the Bank’s services can be used by pro-ducers and buyers. The buyers’ bank emits creditletters proving that a buyer is financially able topay a coffee order. Also, after the goods’ arrival, amoney transfer takes place between the two sides’banks. We consider that the banks must have rea-soning abilities (e.g. for treating the clients differ-ently in function of their financial power) so werepresent them as agents.The figure 1 presents a high level architecture ofour application, independent of the chosen pro-gramming language, framework or environment.

Figure 1. Coffee e-commerce architecture

3. Design

This section presents the design of the applicationusing the CLAIM language.

3.1. CLAIM at a glance

In order to better understand the agents’ defini-tions resumed in the next sub-section, we present

here a brief description on the language.

CLAIM is a high-level declarative language whichcombines cognitive elements in order to endowagents with intelligent skills, and computationalaspects such as mobility. The language’s specifica-tions were presented in [10] and its operational se-mantics in [12]. It can be used to define agents orclasses of agents. A multi-agent system in CLAIMis a set of hierarchies of agents located on differ-ent computers in a network. A CLAIM agent is anautonomous, intelligent and mobile entity unique-ly identified in the MAS, located at a node of ahierarchy. Thus, an agent has a parent and mayhave several sub-agents. In addition, he has intel-ligent components such as knowledge, goals andcapabilities allowing a reactive or a goal-drivenbehavior.

An agent has a knowledge base containing piecesof information about the other agents’ classes andcapabilities or user-defined pieces of informationabout the environment they are acting in, repre-sented as propositions containing a name and alist of arguments.

Agents’ behavior is dictated by the received mes-sages or by his goals. An agent can have sev-eral goals, represented as propositions. In orderto achieve a goal, he tries to execute capabilitieswhose effects correspond to the current goals.

Therefore, the capabilities are the main elementsof an agent, allowing to execute actions or toachieve goals. A capability has a name, a messageof activation, a condition, the process to executeand eventual effects (post-conditions):capability ::= capabilityName {

message=(null | m);condition=(null | condition);do { pi }effects=null; | { e1; e2; ...; en }

}To execute a capability, the agent must receivethe activation message and verify the condition.A condition can be a Java function that returns aboolean, or a condition about the agent’s knowl-edge, sub-agents or about his achieved effects.

Once a capability activated, the correspondingprocesses are executed (concurrently with the al-ready running processes of the agent). So anagent (e.g. α) contains a set of concurrent run-ning processes, Pα = pi | pj | ... | pk. One of theseconcurrent processes can be a (possibly empty)sequence of processes, a message transmission,

Inteligencia Artificial Vol. 9, No 25, 2005 5

the creation of a new agent (instance of an al-ready defined class), a mobility operation, a vari-able instantiation, a function defined in anotherprogramming language (in this version it is possi-ble to invoke only Java methods), a Web Serviceinvocation (a known Web Service; we are current-ly working on an extension of the platform whereagents dynamically search and invoke Web Ser-vices), or the execution of a process for all theagent’s elements from the knowledge base or hissub-agents that verify a certain criteria.pi ::= 0 | pj .pk | send(α,m) |

newAgent name : class(args) |in(β) | out(β) | move(β) |open(β) | acid | kill(β) |?x = (value | Java(object.method)) |?x = WebService(address, method) |Java(object.method(args)) |forAllKnowkedge(k){pj} |forAllAgents(αi){pj}

The send primitive allows a message transmis-sion to another agent, to all the agents belongingto a class (multicast) or to all the agents in thesystem (broadcast). There are pre-defined mes-sages, used during the mobility protocols for ask-ing and granting permissions, or used by agentsto exchange information about their capabilitiesand knowledge bases. The users can also definetheir own messages, represented as propositionsand utilized to activate capabilities.

The mobility operations are inspired from the am-bient calculus [5]. Using in, an agent can enteranother agent from the same level in the hierar-chy (i.e. having the same parent) and using out,an agent can exit his parent. Unlike the ambi-ent calculus, where there is no control, we addedan asking/granting permission mechanism. Themove mobility operation is a direct migration toanother agent, without verifying a structure con-dition. Nevertheless, the operation is subject topermissions. Taking full advantage of the hierar-chical representation of the agents, using the openprimitive, an agent can open the boundaries ofone of his sub-agents, thus inheriting, as in theambient calculus, the later’s running processesand sub-agents, but also his knowledge and capa-bilities. The acid primitive is similar to open, butit is an agent that decides to open his own bound-aries, and as a consequence, his components areinherited by his parent. So in both cases, an agentdynamically gathers new capabilities and enricheshis knowledge base.

These intelligent elements allow two types of rea-soning for the CLAIM agents: forward reasoning

(or reactive behavior) - activate capabilities whenthe corresponding messages arrive and the condi-tions are verified; backward reasoning (or goal-driven behavior) - execute capabilities in order toachieve goals.

CLAIM (in conjunction with the SyMPA plat-form resumed in the section 4.1) has already beenused for several applications such as an informa-tion search on the Web [11], another e-commerceapplication [10], a network of digital libraries [20]and a resource sharing and load transfer applica-tion using mobile agents [21].

3.2. Agents’ definitions in CLAIM

In this sub-section, starting from the agents’ de-scriptions presented above, we will summarize theimplementation process using CLAIM. For eachagent we present only the most important cogni-tive aspects and capabilities. There are elementsof the language that were not presented but thatappear in the definitions (e.g. variables noted ?xcan be used).

The CRCV agent’s knowledge base containspieces of information about the quality of the pro-ducers’ coffee. An entry in the knowledge baseis represented as: Producer(name, type, quality)(e.g. Producer(P1, oro, 8)). CRCV has capabili-ties for creating a Verifier when a producer asksfor certification and can answer the buyers’ ques-tions about the quality of the producers’ coffee.Agent CRCV {

...

capabilities {certifyProducer {message=askForCertification(?type);

condition=null;

do{newAgent Ver:Verificator().

send(Ver,verify(sender,?type))}effects=null;

}verifyProducerOK {message=verifyProd(?pr,?t,?q);

condition=hasKnowledge(Producer(?pr,?t,?q));

do{send(sender,prodOK(?pr,?t,?q))}effects=null;

} ... } ...

}

A Verifier agent is created by the CRCV agenteach time a producer asks for certification. Heis instantiated from a class whose definition con-tains a capability for migrating to producers, for

6 Inteligencia Artificial Vol. 9, No 25, 2005

giving a qualitative appreciation to the coffee(calling a Java method) and for giving this infor-mation to CRCV.AgentClass Verifier() {

...

capabilities {verify {message=verify(?pr,?type);

condition=null;

do{move(?pr).?q=Java(Verificator.verifyQuality(?type)).

send(?producer,quality(?type,?q)).

move(authority).

send(authority,tell(Producer(?pr,?type,?q))).

acid}effects=null;

} } ...

}

The Producer agents’ definition is more com-plex and takes into account all the interactionswith the CRCV agent, with the Market, with thepotential buyers and with the transport and in-surance companies. We present only two of his ca-pabilities. First, after certifying his coffee, a pro-ducer sends his offer to the Market and receives alist of interested buyers (represented in the knowl-edge base as Buyer(name, type, quality, quant),e.g. Buyer(B1, oro, 7, 500)). He uses a Java func-tion to select a buyer from the list. In the secondcapability presented, after signing an agreementwith a buyer, a producer invoke Web Servicesof the known Transport companies (and similar-ly for insurance) for finding their prices and forchoosing later the best price.AgentClass Producer(?bank) {

...

capabilities {chooseBuyer {message=knowInteresBuyers(?t,?qual,?price);

condition=hasKnowledge(Buyer(?n,?t,?qual,?q));

do{?b=Java(Prod.selectBuyer(this,?t,?qual)).send(?b,offer(?t,?qual,?price))}

effects=null;

}findTransport {message=findTransport(?quant);

condition=null;

do{forAllKnowledge(Transport(?n,?ad,?prM)) {?pr=WebService(?ad,?prM)).

send(this,tell(TransportPrice(?n,?pr))) }.?bestTr=Java(Prod.selBestTrPrice(this)).

send(?bestTr,transportOrder(?quant)) }effects=null;

} ... } ...

}

The Buyer agents have complementary but sim-ilar capabilities with the producers’ ones. Theysend requests to the market, receive a list of pro-ducers, select one of them in function of differentcriterions (e.g. best price, other buyers’ opinions),verify the certification of the chosen producer, ne-gotiate with him and finally receive the coffee af-ter the bank transfer is done.

The main functions of the Market agent is tomatch the producers’ offers with the buyers’ re-quests stored in his knowledge base (the piecesof information about the producers’ offers havethe format Producer(name, type, quality, price),e.g. Producer(P1, oro, 8, 15) and those about thebuyers’ requests have been presented before, e.g.Buyer(B1, oro, 7, 500)).Agent Market {

...

capabilities {offersFromProd {message=prodOffer(?t,?q,?pr);

condition=null;

do{send(this,tell(Producer(sender,?t,?q,?pr))).forAllKnowledges(Buyer(?b,?t,?q,?qt)) {send(sender,tell(Buyer(?b,?t,?q,?qt))) }.

send(sender,knowInteresBuyers(?t,?q,?pr)) }effects=null;

} ... }...

}

The Bank has information about the clients andtheir accounts. It also emits credit letters for buy-ers. At the end, a money transfer is made fromthe buyer’s account to the producer’s bank.

4. Implementation

Once the agents and the classes of agents are de-fined, we deployed the application on the SyMPAplatform. Its main features are presented in thenext sub-section.

4.1. Overview of SyMPA

SyMPA [26] (System Multi-Platform of Agents)is a distributed platform that offers all the neces-sary mechanisms for a safe execution of a distrib-uted MAS implemented using CLAIM. SyMPA isimplemented using the Java language and its ar-chitecture is compliant with the specifications of

Inteligencia Artificial Vol. 9, No 25, 2005 7

the MASIF [24] standard from the OMG.

SyMPA consists of a set of connected comput-ers. On each computer there is an agent sys-tem that provides mechanisms for agents’ man-agement, authentication, authorization, resourcesaccess control and fault tolerance. There is also aCentral System that has management functions.SyMPA’s architecture is presented in the figure 2.

Figure 2. SyMPA’s Architecture

An agent system is deployed on each comput-er connected to the platform. It provides (fig-ure 3) a graphical interface for defining and cre-ating agents and for visualizing their execution,a CLAIM compiler, mechanisms for agents’s de-ployment, communication, migration and man-agement, all of these in a secure and fault tolerantenvironment.

Figure 3. SyMPA’s Features

An agent system offers visual tools and an editorwhere the agents’ designer can define the agentsor the classes of agents needed for the applica-tion, in a .adf (agents description) file. Never-theless, any other text editor can be used. The

definitions are then interpreted, the CLAIM syn-tax is verified and the agents (.agd) and classes(.cld) files are created in a format understandableby the Execution Engine. The interpreter was im-plemented using JavaCC (Java Compiler Compil-er) 3. The running agents are charged in memoryand executed. There is a corresponding (optional)graphical interface for each running agent, whereone can visualize agent’s behavior, communica-tion and migration.

The agent system is also in charge with the com-munication with other agent systems or with thecentral system and deals with the mobility, takinginto account the security constraints. The com-munication and the mobility are implemented us-ing Java above the TCP/IP protocol. As a resultof our hierarchical representation of the agentswe can distinguish two types of migration : localand remote migration. The local migration takesplace inside a hierarchy, using the primitives thatwe have already presented. Thus, an agent moveswith all his components in the local hierarchy.The remote migration is the migration betweenhierarchies (between different computers), usingthe move primitive. In CLAIM, the remote mi-gration is strong at the CLAIM processes level,because the state of an agent is saved before themigration, it is transferred to the destination andthe processes are resumed from their interruptionpoint. At the Java level, we use the Java VirtualMachine migration facilities (e.g. Class Loader,object serialization), so there is a weak migra-tion. A Java method begun before the migrationwill be reinvoked after the successful arrival atthe destination.

The mobile agents are programs running in a dis-tributed and insecure environment (e.g. the In-ternet) where there are possible different attacksagainst the host agent systems and against anagent during the migration or during his execu-tion. Several solutions exist to these attacks [16],but they are outside the scope of this paper. InSyMPA, for the agent systems’ protection, we areusing agents’ authentication, the control of theaccess to the system’s resources in accordancewith a set of permissions given to agents in func-tion of their authority, and audit techniques. Forthe agents’ protection, we are using encryptionand also fault tolerance mechanisms. The read-er can find in [26] a detailed description of thesesecurity aspects in SyMPA.

3JavaCC on-line at https://javacc.dev.java.net/

8 Inteligencia Artificial Vol. 9, No 25, 2005

4.2. Implementation and tests

The classes of agents presented in the section 3.2.were edited and compiled using the SyMPA in-terface. The Transport and Insurance Web Ser-vices were implemented using the J2EE frame-work. We started a couple of different Transportand Insurance Web Services, with different pricesfor the offered services. Next, using SyMPA andthe already defined agents and classes, we start-ed the CRCV agent, the Market and a Bank (forboth producers and buyers). After the “stable”stationary agents and services were deployed, weexecuted several producers on different comput-ers, they asked for certification at CRCV; cre-ated by CRCV, Verifiers migrated to each newproducer, verified the quality of the coffee andsent this information to CRCV. The producerssent their offers to the market, but there were nomatching buyers at that moment. So we instanti-ated next several buyers whose requests matchedsome of the producers‘ offers. Successful proto-cols and transactions took place between severalbuyers and producers, the goods arrived at thedestination and the money was transferred to theproducers’ bank. The figure 5 presents the graph-ical interface of the running agents.

The complexity of this application and the ob-tained results prove the strength and the expres-siveness of the CLAIM language and the solidityof our platform. Using the same concepts for thedesign and for the implementation and using theagent-specific actions and mechanisms offered byCLAIM, the implementation duration was sub-stantially reduced.

Figure 5. Application‘s graphical interface

5. Related Work

As we have seen, this paper presents a complexe-commerce application implemented using theagent-oriented programming language CLAIMsupported by the SyMPA platform. This workis situated at the intersection of several domainsand should be positioned with respect to all ofthem.

First, CLAIM combines elements from the AOPlanguages, such as AGENT-0 [25], AgentS-peak [27], 3APL [19] (and their extensions), thatare suitable for representing intelligent agents en-dowed with cognitive skills but lack clear mecha-nisms to deal with mobility and distribution, andelements from the concurrent languages, such asthe ambient calculus [5], the safe ambients [23]or Klaim [8], that enable to represent concurrentprocesses, that can communicate and migrate ina distributed environment, but are not suitableto represent intelligent aspects of agents. Tele-script [28] and April (with its object oriented ex-tension April++) [7] focus on the mobility aspectof agents; nevertheless these languages have nei-ther the reasoning capabilities of the AOP lan-guages nor the formal solidity of the concurrentlanguages.

Several platforms supporting mobile agents ex-ist nowadays, such as Aglets [1], D’Agents [15] orGrasshopper [2]. All of them offer mechanisms forthe agents’ creation, communication, migrationand management, guaranteeing in the same timea high level of security. However, the supportedagents are implemented using mainly Java, so theagents are actually mobile objects. JADE [3] is aJava-based platform, FIPA-compliant, that offerssupport for Java agents execution, communica-tion and (recently) migration. Another platformthat has common elements with our approach isJason [4], an interpreter implemented in Java foragents designed in AgentSpeak.A presentation of the AOP languages and of theconcurrent languages can be found in [10] and ofthe mobile agents platforms in [26].

From the application point of view, agents havebeen used to develop many e-commerce environ-ments, because of their advantages stressed in thefirst section. However, to our knowledge, thereis no e-commerce application implemented in anagent-oriented language. Usually Web approach-es (dynamic Web pages, ASP, JSP, Java Script,frameworks such as J2EE or .NET, etc), Java or

Inteligencia Artificial Vol. 9, No 25, 2005 9

other object-oriented languages are used for im-plementing agent-oriented applications.In [18] is presented a survey of the e-commercesystems using agents and of the roles agents playas mediators in different stages of a customer tobuyer scenario. There are systems such as Jan-go [9] or Tete-a-Tete [17] whose agents are use-ful in the Product Brokering stage (i.e. informa-tion retrieval to help to determine what to buy).Jango, Kashbah [6] or Tete-a-Tete use agentsduring the Merchant Brokering phase (i.e. de-termine who to buy from). And during the Ne-gotiation phase, Kashbah or Tete-a-Tete provideagents that establish the terms of the transac-tions. ABROSE [14] is a large scale project try-ing to create an agent-based brokerage service toprovide user support for request, navigation, reg-istration and propagation of information.Many other applications and systems for e-commerce using agents that we did not cite hereexist. They try to exploit the agents’ advantagesbut do not use an agent-oriented approach as inour case. The developer uses agent concepts forthe design phase and then must translate theseconcepts into an object-oriented framework. Thisgap is not present in our approach.

6. Conclusion

This paper presents the results of a project wedeveloped in a French-Mexican collaboration con-text (LAFMI laboratory). This project consists ofa generic framework for the design of distributedapplications based on MAS technology and mo-bile computing.

The proposed framework is constituted of anagent oriented language for MAS design (i.e.CLAIM), a distributed platform to support suchMAS (i.e. SyMPA) and a real-world internationale-commerce scenario (coffee Market of Veracruz)that takes benefit from MAS concepts and havebeen implemented using CLAIM and SyMPA.

Face to the increasing interest in the e-commercedomain and the several developments that havebeen proposed to deal with, one of our projectmotivation was to fully exploit this domain’s po-tential by introducing MAS paradigm. We arguehere that MAS technology is useful to bring newinteresting concepts to design intelligent applica-tions/systems that require sophisticated interac-tions, intelligent behaviors and autonomy. Thesefeatures enable to introduce more flexibility in

the designed system, to sustain both individu-al and collective intelligent behaviors, and con-sequently to improve the global performance ofthe whole system. Hence, the approach presentedin this paper takes benefit of the main advantagesof the MAS technology. It goes on to use the pow-er of mobile computation thanks to our languageCLAIM and the SyMPA platform.

The complexity of the international e-commerceapplication and the first results of our proto-type prove the strength and the expressivenessof CLAIM and the robustness of the platform.

Our future work aims to introduce several im-provements such as the use of mobile agents togather information about the producers’ and buy-ers’ history, or the coalitions’ formation by theproducers using cooperation protocols.

Referencias

[1] Aglets: http://www.trl.ibm.co.jp/aglets.

[2] Grasshopper: http://www.grasshopper.de.

[3] F. Bellifemine, A. Poggi, and G. Rimassa.JADE - a FIPA-compliant agent framework.In Proceedings of PAAM’99, pages 97–108,London, U.K., 1999.

[4] R.H. Bordini and J.F. Hubner. Ja-son, a Java-based AgentSpeak inter-preter used with Saci for multi-agentdistribution over the net. On-line athttp://jason.sourceforge.net.

[5] L. Cardelli and A.D. Gordon. Mobile ambi-ents. Foundations of Software Science andComputational Structures, LNAI, 1378:140–155, 1998.

[6] A. Chavez, D. Dreilinger, R. Guttman, andP. Maes. A real-life experiment in creating anagent marketplace. In Proceedings of PAAM’97, London, UK, 1997.

[7] K.L. Clark, N. Skarmeas, and F. McCabe.Agents as clonable objects with knowledgebase state. In Proceedings of ICMAS96.AAAI Press, 1996.

[8] R. de Nicola, G.L. Ferrari, and R. Pugliese.Klaim: a kernel language for agents inter-action and mobility. IEEE Transactions onSoftware Engineering, pages 315–330, 1998.

10 Inteligencia Artificial Vol. 9, No 25, 2005

[9] R. Doorenbos, O. Etzioni, and D. Weld.A scalable comparison-shopping agent forthe world wide web. In Proceedings ofthe First Interational Conference on Au-tonomous Agents, 1997.

[10] A. El Fallah Seghrouchni and A. Suna.Claim: A computational language for au-tonomous, intelligent and mobile agents.Proceedings of ProMAS’03 Workshop of AA-MAS, LNAI, 3067:90–110.

[11] A. El Fallah Seghrouchni and A. Suna.An unified framework for programmingautonomous, intelligent and mobileagents. Proceedings of CEEMAS’03,LNAI, 2691:353–362, 2003.

[12] A. El Fallah Seghrouchni and A. Suna. Pro-gramming mobile intelligent agents: an oper-ational semantics. In Proceedings of IAT’04,Beijing, China, 2004. IEEE Press.

[13] J. Ferber and O. Gutknecht. A meta-modelfor the analysis and design of organizationsin multi-agent systems. In Proceedings of theThird International Conference on Multi-Agent Systems (ICMAS98), pages 128–135,Paris, Frace, 1998.

[14] M.-P. Gleizes and P. Glize. ABROSE: Mul-ti agent systems for adaptive brokerage. InProceedings of the AIOS 2002 workshop ofCAiSE, 2002.

[15] R.S. Gray, D.Kotz, G.Cybenko, and D. Rus.D’agents: Security in a multiple-language,mobile-agent system. Mobile Agents and Se-curity, LNCS, 1419:154–187, 1998.

[16] M.S. Greenberg, J.C. Buyington, and D.G.Harper. Mobile agents and security. IEEEComunications Magazine, 36(7):76–85, 1998.

[17] R.H. Guttman and P. Maes. Agent-mediatedintegrative negotiation for retail electroniccommerce. In Proceedings of of AMET’98,1998.

[18] R.H. Guttman, A. Moukas, and P. Maes.Agent-mediated electronic commerce: Asurvey. Knowledge Engineering Review,13(2):147–159, 1998.

[19] K.V. Hindriks, F.S. deBoer, W. van derHoek, and J.J.Ch. Meyer. Agent program-ming in 3APL. Intelligent Agents and Multi-Agent Systems, 2:357–401, 1999.

[20] G. Klein, A. Suna, and A. El FallahSeghrouchni. A methodology for buildingmobile multi-agent systems. In Proceedingsof the 6th International Symposium on Sym-bolic and Numeric Algorithms for ScientificComputing SYNACS04, Timisoara, Roma-nia, 2004.

[21] G. Klein, A. Suna, and A. El FallahSeghrouchni. Resource sharing and load bal-ancing based on agent mobility. In Proceed-ings of ICEIS’04, 2004.

[22] D.B. Langeand and M. Oshima. Seven goodreasons for mobile agents. Communicationof the ACM, 42:88–89, 1999.

[23] F. Levi and D. Sangiori. Controlling in-terference in ambients. In Proceedings ofthe 27th ACM SIGPLAN-SIGACT sympo-sium on Principles of programming lan-guages, pages 352–364. 2000.

[24] D. Milojicic, M. Breugst, I. Busse, J. Camp-bell, S. Covaci, B. Friedman, K. Kosaka,D. Lange, K. Ono, M. Oshima, C. Tham,S. Virdhagriswaran, and J. White. MASIF,the OMG mobile agent system interoperabil-ity facility. In Proceedings of Mobile Agents,pages 50–67. 1998.

[25] Y. Shoham. Agent oriented programming.Artificial Intelligence, 60:51–92, 1993.

[26] A. Suna and A. El Fallah Seghrouchni. Amobile agents platform: architecture, mobil-ity and security elements. In Proceedingsof ProMAS’04 Workshop of AAMAS, New-York, 2004.

[27] D. Weerasooriya, A. Rao, and K. Ramamo-hanarao. Design of a concurrent agent-oriented language. Intelligent Agents: The-ories, Architectures, and Languages, LNAI,890:386–402, 1995.

[28] J. White. Mobile agents. In Software Agents,MIT Press, 1997.