JAPL: the JADE Agent Programming Language
Total Page:16
File Type:pdf, Size:1020Kb
272 JOURNAL OF EMERGING TECHNOLOGIES IN WEB INTELLIGENCE, VOL. 5, NO. 3, AUGUST 2013 JAPL: the JADE Agent Programming Language Mohamed BAHAJ, Abdellatif SOKLABI FSTS/ Department of Mathematics and Computer Science, University Hassan I Settat, Morocco [email protected] [email protected] Abstract— This article describes JADE Agent Programming particular, we highlight knowledge representation. The Language (JAPL) that allows fast and efficient following section contains the programming treatment implementation of intelligent behaviors into mobile agents, agent’s behaviours. The sixth section finalizes this part based on three logical, FIPA speech acts, and a part of with a focus on the service concept, and the last section complex procedural script for actions. It integrates the we wrap up with some conclusions. ontologies and defines communication services. Rather than rely on a library of plans, JAPL allows agents to plan from II. JADE AGENT PROGRAMMING LANGUAGE first principles. It also describes how to program the multiple OVERVIEW: JADE behaviors using JAPL instructions and how to JAPL is the extension of ADL (Action Description compile JAPL to JAVA classes. Language) [18] on the mobile agents of JADE. ADL Keywords— Mobile agents, JADE, Agent programming allows the use of quantifiers and conditional expressions language, agents communication, MAS in the description of operators to describe classical planning. In ADL, the focus of the quantifiers is over I. INTRODUCTION: finite domains and disjunction that are not allowed in the JADE (Java Agent Development Environment) is the expression of effects, because it would bring non- system for mobile agents, most used in the world. It is deterministic actions. ADL is a good representation of adapted to the rules of FIPA [10] and is programmed as a formal references in classical planning. JAPL is a basic object-oriented programming language Java, but the computer language that standardizes description of development of a complex application is not yet clear and planning problems. Also it is a PDDL (Planning Domain it requires a lot of concentration, effort and time [4]. Description Language [15]), which allows it to specify the In the literature, many programming languages for possible operators, the relationships and environmental mobile agents ware created as: Cougaar [6], MetateM [7], constraints, the initial state and the goal states. AgentSpeak (L) [8], [15], MadKit [12], 3APL [9], [13], JAPL provides open world semantics. It includes four Golog [14], [17] and SWAM [3]. These languages are essential elements; plans element, rules, ontologies and used in the prototyping phase, in order to provide a high services. One of the main features for agents is that they level application design-based to mobile agents, who try can communicate via services. Taking into consideration to follow the architecture Belief- Desire-Intension [16, 15]. the view of the agent about the execution, a service call is In this paper, we present the programming language of handled in the same way as the execution of internal JADE agents: "JADE Agent Programming Language". It actions. This is possible because the services have the was designed to implement many complex applications by same structure as actions. They obtain; pre-conditions and assigning high mental level concepts to mobile agents, so post-conditions, and the body (which contains the actual they reach a new abstraction level that allows their code to be executed) is reduced to service calls, which programming as reactive behaviours instead of allows us to integrate advanced features such as safety, in programming as meaning. In addition to these features, JADE. In addition, the programming of complex the agents will have the ability to schedule other tasks in communication scenarios becomes easier, because all order to accomplish the tasks that have been assigned. messages are processed in a clearly defined framework. In First of all, section 2 presents broad overview of the the following sections we will detail some of JAPL’s different items JADE Agent Programming Language. different regions, namely knowledge representation, the Secondly, section 3 talks about the state of the art. Thirdly, behavior of agents, and communications. section 4 describes its different features in some detail. In ©2013 ACADEMY PUBLISHER doi:10.4304/jetwi.5.3.272-277 JOURNAL OF EMERGING TECHNOLOGIES IN WEB INTELLIGENCE, VOL. 5, NO. 3, AUGUST 2013 273 III. STATE OF THE ART: integral part of language, and the programmer is forced to In the literature there are many programming languages deal with uncertainty in the development of a new agent. of agents, represent a family of programming languages Therefore, JAPL can handle incomplete or incorrect which allows developers to create high-level abstractions information explicitly. and structures which are necessary for the implementation JAPL allows knowledge bases that are most used in the of mobile agents. It is possible to classify them in two other languages to be defined. Each object that refers to categories, those based on logic as AgentSpeak (L) [15], the language needs to be defined in ontology. JAPL [8], 3APL [9], [13], Golog [17], MetateM [7] and SWAM implements strong typing, because the variables flow in [3], and those based on object-oriented programming classes rather than sets of speech. It should be noted here language Java such as Cougaar, [6] and MadKit [12]. that the alphabet JAPL consists of variables, functions, These languages are mostly in the prototype stage, and symbols, actions, quantifiers, connectors, and punctuation provide high-level concepts that implement some notion symbols. We also use “?” (for testing), “!” (for of BDI [16], [1]. realization), “and” (for sequencing) and “1” (for AgentSpeak (L) programming language is the most implication). Classes are represented in a tree structure. developed programming language, and is an article Each node represents a class with a set of attributes. comparing this language to other languages [15]. ALAS Classes are defined as follows Fig. 1: and IndiGolog are the newest programming languages of mobile agents. ALAS is a fast, effective, simple and (Class object classname) powerful programming language of reactive agents. It has been designed to support the execution of agents in heterogeneous environments, and allow easy use of Fig.1: Example of JAPL class representation. features of agents, such as mobility [2]. IndiGolog is a JAPL allows multiple inheritances. The classes inherit programming language for autonomous agents that detect all attributes of all ancestors. Therefore, the problem of their environment and plan their tasks. IndiGolog supports names conflicts are not posed, since the attribute names the execution of high-level programs, gives programmers have been expanded to include the class structure. In the ability to create high-level and non-deterministic addition to classes, JADE Agent Programming Language programs, tests agent tasks and provide a declarative can define methods and comparisons. The interpretation specification of the domain in calculated situations [5]. of the methods is given by the operational semantics. In However, all these languages are widespread and are not practice, methods are coded in JAVA. suitable for the distinction of all mobile agents systems. Complex actions describe functional capabilities of We used the strong point in these programming languages agents. They in turn can call Java methods, or use JAPL. for mobile agents and created a simple and efficient There are different types of complex actions or language, while respecting the particularity of JADE. invocations of services. They all have the same structure; IV. THE KNOWLEDGE REPRESENTATION: they consist of three main elements, in addition to the JAPL has been designed to respond to the need of name of the action Fig. 2: JADE, for a flexible and dynamic language, that allows for the migration of agents and services at any time and (action ActionName pre PreCondition eff which makes the local information’s validity very short. Effect Body) So every programming system that supports dynamic Fig. 2: Example of JAPL actions representation. behavior needs to address the issue of synchronization and information sharing. So research in the domain of An action is called using the following code Fig. 3: transaction management tries to find solutions to the issue of synchronization [11]. (call role-interface action-id [variable]) Our approach, however, is to integrate the idea of Fig. 3: JAPL action call example uncertainty about the bits of information in the presentation of knowledge to allow programmers to V. AGENT BEHAVIOUR: manage incorrect or expired information. We integrated A. SimpleBehaviour and Action selection: the concept of uncertainty using calculated situations As JADE Agent Programming Language is intended to which have three assessed logics. The third truth value is be interpreted in a BDI-like architecture, it incorporates added to the predicate and cannot be evaluated with the the notion of achievement agent tasks SimpleBehaviour. information available to a particular agent. Thus, a The SimpleBehaviours of the agent are implemented as predicate can be explicitly evaluated as unknown. It is an ©2013 ACADEMY PUBLISHER 274 JOURNAL OF EMERGING TECHNOLOGIES IN WEB INTELLIGENCE, VOL. 5, NO. 3, AUGUST 2013 simple commands that the agent tries to respond to once states via conjunction function with one or more they are activated.