A Case Study of the JADEL Programming Language Federico Bergenti∗ , Eleonora Iotti† , Stefania Monica∗ and Agostino Poggi† ∗ Dipartimento di Matematica e Informatica Università degli Studi di Parma Parco Area delle Scienze 53/A, 43124 Parma, Italy Email: federico.bergenti@unipr.it, stefania.monica@unipr.it † Dipartimento di Ingegneria dell’Informazione Università degli Studi di Parma Parco Area delle Scienze 181/A, 43124 Parma, Italy Email: eleonora.iotti@studenti.unipr.it, agostino.poggi@unipr.it Abstract—This paper presents and discusses a first complete These difficulties are due to the fact that JADE has grown in example of the use of JADEL. JADEL is a novel agent-oriented complexity and now it has a steep learning curve. domain-specific programming language built on top of JADE, the JADE allows users to make appropriate design choices for well-known agent platform which provides solid agent technology and several tools for the creation of agents and multi-agent their specific application domains, without forcing them to rely systems. The purpose of JADEL is to make the development on a specific agent model. Such flexibility and adaptability of JADE agents and multi-agent systems easier and clearer by makes it a very powerful instrument that can be applied to means of specific abstractions and a lighter syntax. In order several domains. The disadvantage of such an approach is that to understand, and properly assess, the actual advantages of the agent-oriented features have been used in many different using JADEL, a well-known JADE demo that uses JADE- specific features like ontologies and interaction protocols has been ways, resulting in a loss of transparency of the agent model. rewritten in JADEL. This paper first briefly presents the main Finally, the AOP (Agent-Oriented Programming) paradigm features of JADEL, then it discusses the rewritten demo and is inherently different from the OOP (Object-Oriented Pro- compares it with original JADE code. gramming) one. As a matter of fact, agents are character- ized by mental states and they exchange specific types of I. I NTRODUCTION messages, responding to them in a truthful and consistent JADEL (JADE Language) [1] is a novel programming lan- way. To this extent, agents are viewed as specialization of guage that provides agent-oriented abstractions and domain- objects [12], [13]. For this reason, the management of agents specific expressions to help the development of JADE multi- and multi-agent systems often requires the use of specific agent systems. JADE (Java Agent DEvelopment framework, languages, which focus on agent-oriented abstractions and jade.tilab.com) [2] is a software framework that permits to provide particular constructs and structures. In order to match build complex and distributed multi-agent systems. A wide the AOP paradigm, JADE APIs offer facilities written in Java. variety of extensions and APIs are provided with JADE and This design choice was made in the early stage of JADE the documentation of JADE APIs is exhaustive and clear. development and it presents several advantages: it makes JADE allows use of agent technology in various areas, such possible to develop applications compliant with agent-oriented as smart emergency applications [3] and localization [4], [5]. technologies and it ensures interoperability with other Java JADE is currently maintained and in recent years some related libraries and applications. Despite its advantages, at the present projects have been developed. In particular, WADE [6], [7] day, a Java-only approach is often perceived as a limitation, (Workflows and Agents Development Environment) adds a due to the rising of several valid alternatives and the increased lightweight workflow engine to JADE agents, thus supporting popularity of domain-specific solutions tailored on the needs business process management, and AMUSE [8]–[10] (Agent- of the application and of its context. Such solutions are often based Multi-User Social Environment) focuses on multi player DSL (Domain-Specific Languages) designed intentionally to Android-based online games. These are some of the reasons deal with the chosen domain. These languages have a lighter that make JADE one of the most comprehensive and hence syntax and help avoiding repetitive tasks, workaround and most popular FIPA-compliant agent platform [11]. Although unclear technicalities. there is a wide and clear documentation of JADE APIs, new In summary, the main problems in developing agent-based developers and students in the field of agents and multi- applications and multi-agent systems in JADE today can be agent systems may have difficulties in approaching JADE. listed as follows. First, the complexity of the framework As a matter of fact, users of JADE have to deal with lots of requires not only expertise in management of distributed multi- complementary technical details that are sometimes perceived agent systems but also a deep understanding of JADE mech- as difficult and confusing in terms of agent-oriented features. anisms. Second, the lack of a fixed agent model sometimes 85 causes unclear or incorrect utilizations of the available agent agents, while expressions are used, for instance, to create technologies. Finally, some procedures and patterns become agent behaviours. In Section II-B such features are described repetitive or verbose, hence not clear in terms of AOP, due to in detail. the gap between the AOP and OOP paradigms. The above listed criteria must not be seen as a limitation. On The solution proposed to address these problems is JADEL, the contrary, they represent a tentative of making JADEL code which was first presented in [1], [14]. JADEL is an agent- simple and readable, without detracting from its expressive- oriented DSL which aims at reducing the complexity of ness. As a matter of fact, the underlying JADE platform and JADE by providing a new syntax relying completely on the interoperability with Java given by Xtext and Xtend ensure agent abstractions. According to this syntax, constructs and the possibility of embedding JADE native implementations. expressions are introduced in order to write simple and clear agent programs. JADEL is developed with the Xtext A. Abstractions framework (www.eclipse.org/Xtext), which ensures a tight In terms of syntax, all JADEL abstractions are declared integration with the JVM and provides a specific language in a similar way, namely with a keyword that identifies the that can be used as host language of the DSL. This specific abstraction, followed by the name of the entity and its relations language is called Xtend (www.eclipse.org/xtend) and it is with other declared entities. After the declaration, a block of a dialect of Java. An advantage of the use of Xtend is that code contains the description of its main features, by means JADEL programs generate Java source code which is easily of specific constructs. readable and which runs as fast as the equivalent Java code. The first entity that we discuss is the communication on- This feature makes also possible the embedding of JADE tology. In detail, communication ontologies contain the defini- native code. As a consequence, the use of JADEL is quite tions of propositions, composite concepts and predicates. From straightforward for Java and JADE users. JADEL is still under a theoretical point of view, propositions are first-order logic development and an evaluation of its capabilities, usability well-formed formulas. In JADEL they are declared simply by and effectiveness is necessary. This paper presents a JADEL means of the keyword proposition followed by a name. translation of the Meeting Scheduler demo, a well-known Basic (or atomic) concepts are simple terms that can be used in example of JADE that comes together with JADE distribution. JADEL, but they do not have to be declared, because they are The structure of the paper is as follows. In Section II, provided directly by JADEL. Composite concepts are defined JADEL main ideas and abstraction are presented, together with by means of other basic or composite concepts. According to a brief explanation of its syntax. Then, Section III introduces JADEL syntax, composite concepts can be declared by using the Meeting Scheduler example in JADEL and its comparison the keyword concept followed by the name of the concept with the JADE implementation. Finally, Section IV concludes and by a list of parameters. Such parameters identify the the paper with a discussion of the results and future develop- other concepts that compose the one that is being declared. ments and improvements. Predicates have a similar syntax and their parameters can be basic or composite concepts. Predicates do not state a fact nor II. T HE JADEL P ROGRAMMING L ANGUAGE IN B RIEF describe an entity, but they make relations among concepts, as As previously explained, the scope of JADEL is to simplify in the semantics of logic predicates. the creation of JADE agents and multi-agent systems and The second entity is the behaviour. In JADEL, behaviours to make the agent model clearly visible, avoiding technical are used to define actions that can be performed by agents and implementation details as much as possible. JADE APIs and they can be cyclic or oneshot. The difference between consist in a large amount of classes that have various pur- cyclic and oneshot behaviours is that cyclic ones remain in poses, such as the representation of core abstractions and the the agent behaviours list for the entire life of an agent, while management of message passing among agents, from interac- oneshot behaviours are removed after a single execution. Both tion protocols to agent communication languages. Hence, the of them can be associated with a specific agent class. A special choice of the primary features, among those provided by JADE consideration is given to those behaviours that are roles of an classes, is fundamental in the development of a JADE DSL. interaction protocol. Roles are behaviours defined by means In particular, two criteria for the selection of JADEL features of a FIPA protocol name and the role of the agent in such are considered, namely (i) the significance of such features in protocol. In the body of a role, each step of the protocol agent creation and life-cycle and (ii) the FIPA compliance and is handled individually as a particular event caused by the the help they give to manage message passing. According to reception of different types of messages. the previously listed criteria, JADEL core abstractions are the Finally, agents are the most important JADEL entities. In agent, the behaviour and the communication ontology. These their declarations and setup, they put together all the ontologies abstraction are explained in detail in Section II-A. and behaviours that will be used in their life cycles, thus Features of such entities are designed as domain-specific making explicit relations among the various entities. Agents constructs and expressions, whose purpose is to shorten the are multitask single-threaded entities that manage their actions most repetitive tasks and to focus on the agent life-cycle and by means of an internal scheduler. An agent life cycle is behaviour action. Constructs are meant to handle events, e.g., composed of: (i) a start-up phase, during which the agent the reception of a messages and creation or destruction of initializes, (ii) a loop, where actions are performed, and (iii) a 86 final phase of take-down, in which the agent performs cleanup c y c l i c b e h a v i o u r ReplyPong { on message msg tasks. In JADEL, creation and destruction of an agent are when { events, so they are managed with specific constructs, whose content i s ‘ ping ’ } do { syntax is coherent with the one of the behaviour events. send message { p e r f o r m a t i v e i s INFORM B. Domain-Specific Expressions r e c e i v e r s a r e # [ msg . s e n d e r ] ontology i s PingPongOntology Particular expressions are used to manage events, message c o n t e n t i s Pong } passing and domain-specific tasks, such as the behaviours } registration in the agent list. } Events are managed by means of the keyword on, followed by the type of event. Events can be the creation and the III. T HE M EETING S CHEDULER D EMO destruction of an agent, the change of state of a participant in an interaction protocol, and the reception of a message. The Meeting Scheduler demo launches two (or more) Notably, the JADEL construct on − when − do is used in a agents, with their own GUI that consists in a calendar where behaviour body to define an action. In detail, an action can the user can fix and view his/her appointments, invite known be simple, i.e., it does not need an event to be triggered. In users to an appointment, and receive other users invitations. such a case, only the keyword do is used, followed by a block The agent is responsible for the management of the calendar, of code that describes the action. Otherwise, an action can so the user does not have to bother about the overlap of two be triggered by an event, and the keyword on specifies such appointments. As a matter of fact, the agent schedules the event. The keyword when is optional and it can be used to set appointments correctly by messaging with other agents. conditions on the event nature. The JADE source code of the demo consists in (i) a Meeting Communication among agents consists in message passing, Scheduler agent, (ii) a set of classes that manage the GUI, which can be managed with ontologies and/or with interaction (iii) three behaviours, and (iv) an ontology that defines two protocols. Interaction protocols provide a scenario with, at composite concepts. Regarding the behaviours, two of them least, two different roles, initiator and participant, and estab- are implementations of the initiator and responder roles of the lish the types of messages exchanged among agents that are in FIPA Contract Net interaction protocol and the third deals with such roles. JADEL encourages the usage of such technologies the cancellation of an appointment. by providing expressions that allow messages to be viewed as special data structures and by means of specific constructs that A. JADEL Implementation permit creating and sending messages, and extracting message The first entity implemented in JADEL is the communica- contents. These expressions and constructs are exactly the tion ontology, with the concept Person and Appointment, same for each type of message, regardless of their content, whose sub-concepts are declared as parameters. The keyword which can be a string, a sequence of bytes, a concept, a many identifies a list. Declaration of MSOntology is self- proposition or a predicate. contained and it does not need any other classes to define The simple example below shows syntax and usage of some its two concepts, as in JADE. domain-specific expressions. package demo . m e e t i n g s c h e d u l e r . o n t o l o g i e s agent Ping { on c r e a t e { o n t o l o g y MSOntology { var a i d L i s t = # [ newAID ( ‘ pong ’ ) ] c o n c e p t P e r s o n ( s t r i n g name , a i d AID , a i d DFName ) a c t i v a t e behaviour SendPing ( a i d L i s t ) concept Appointment ( a i d i n v i t e r , s t r i n g d e s c r i p t i o n , } d a t e s t a r t i n g O n , d a t e endingWith , d a t e FixedDate , } many P e r s o n i n v i t e d P e r s o n s , many d a t e p o s s i b l e D a t e s ) extends Cloneable a g e n t Pong { } on c r e a t e { a c t i v a t e b e h a v i o u r ReplyPong ( ) } Then, the agent is declared as a JadelGuiAgent, an exten- } sion of the JADE class GuiAgent that provides some built-in o n e s h o t b e h a v i o u r S e n d P i n g ( L i s t a i d L i s t ) { functionalities, e.g., log(String) function, used to manage do { the logging for the agent. Classes that build the GUI are send message { p e r f o r m a t i v e i s INFORM coded in Java, exactly as in the original demo. It is possible to r e c e i v e r s are a i d L i s t refer to those classes into the agent body, thanks to the close content i s ‘ ping ’ } integration that Xtext and Xtend provide with the underlying } } JVM. First, some variables are declared in the ontology PingPongOntology { proposition Ping MeetingSchedulerAgent entity. These will be translated p r o p o s i t i o n Pong into fields of the agent class. According to Xtend syntax, the } keyword val denotes a private final field, while var stands for a mutable private field. 87 the owner agent, protocol name and protocol role. As for the a g e n t M e e t i n g S c h e d u l e r A g e n t u s e s o n t o l o g y MSOntology extends JadelGuiAgent { agent, a list of variables can be specified and the role creation var S t r i n g userName is an event that can be handled as follows. var V e c t o r knownDF = new V e c t o r ( ) var HashMap k n o w n P e r s o n s = newHashMap ( ) r o l e m y F i p a C o n t r a c t N e t I n i t i a t o r B e h a v i o u r ( Appointment var HashMap a p p o i n t m e n t s = a p p o i n t m e n t , L i s t g r o u p ) f o r M e e t i n g S c h e d u l e r A g e n t newHashMap ( ) a s FIPA CONTRACT NET : I n i t i a t o r { var mainFrame mf var A p p o i n t m e n t pendingApp v a l i n t STARTTASKS = 2 var a c c e p t a b l e D a t e s = n e w A r r a y L i s t() v a l i n t FIXAPPOINTMENT = 3 var a c c e p t e d D a t e s = n e w A r r a y L i s t() v a l i n t REGISTERWITHDF = 4 v a l i n t CANCELAPPOINTMENT = 5 on c r e a t e { v a l i n t SEARCHWITHDF = 6 var a c t i o n = new A c t i o n ( ) v a l S t r i n g NAME = ‘ A p p o i n t m e n t S c h e d u l i n g ’ a c t i o n . s e t A c t o r ( t h e A g e n t . AID ) v a l S t r i n g TYPE = ‘ p e r s o n a l −a g e n t ’ action . setAction ( appointment ) v a l S t r i n g PROTOCOL = ‘ f i p a −r e q u e s t f i p a −C o n t r a c t −Net ’ c r e a t e message cfpMsg { p e r f o r m a t i v e i s CFP Then, a setup method is used only to start the GUI, as follows. o n t o l o g y i s MSOntology r e c e i v e r s are group on c r e a t e { content i s action var p a s s w o r d D i a l o g = new P a s s w o r d D i a l o g ( t h i s , } t h i s . localName ) passwordDialog . v i s i b l e = t r u e pendingApp = a p p o i n t m e n t } p r i n t l n ( ‘ I n i t i a t o r msg : ’ + cfpMsg ) } Finally, all needed methods of the agent are defined similarly to those in JADE implementation, with some difference re- Roles are finite-state machine behaviours that change state garding domain-specific expressions. In the following, two of when a new message with a certain performative is received. such methods are shown. As explained in FIPA Contract Net specification, the initiator sends CFP messages to a group of agents and it has to v o i d s t a r t T a s k s ( S t r i n g name ) { handle their responses. In the following, negative responses userName = name mf = new mainFrame ( t h i s , userName + are handled. ‘− A p p o i n t m e n t S c h e d u l e r ’ ) on REFUSE msg { mf . v i s i b l e = t r u e p r i n t l n ( ‘ I n i t i a t o r r e c e i v e d R e f u s e : ’ + msg . t o S t r i n g ) try { } DFService . r e g i s t e r ( t h i s , g e t D F A g e n t D e s c r i p t i o n (NAME, TYPE , MSOntology : : NAME, on NOT UNDERSTOOD msg { userName , PROTOCOL) ) p r i n t l n ( ‘ I n i t i a t o r h a n d l e N o t U n d e r s t o o d : ’ + msg . knownDF += d e f a u l t D F toString ) addKnownPerson ( new P e r s o n ( userName , AID , d e f a u l t D F ) ) } } c a t c h ( FIPAException e ) { e . printStackTrace () on FAILURE msg { mf . s h o w E r r o r M e s s a g e ( e . g e t M e s s a g e ( ) ) p r i n t l n ( ‘ I n i t i a t o r r e c e i v e d F a i l u r e : ’ + msg . t o S t r i n g ) l o g ( e . g e t M e s s a g e ( ) , L o g g e r .WARNING) } } take r o l e myFipaContractNetResponderBehaviour ( t h i s ) In case of acceptance of the CFP by the responder, initiator a c t i v a t e behaviour CancelAppointmentBehaviour ( t h i s ) } handles the propose message, as follows. on PROPOSE msg { void cancelAppointment ( Date d ) { var C a l e n d a r c = C a l e n d a r . i n s t a n c e var A p p o i n t m e n t a p p o i n t m e n t = ge t M y A pp o i n t m e n t ( d ) i f ( a p p o i n t m e n t == n u l l ) { f o r ( d : pendingApp . p o s s i b l e D a t e s ) { mf . s h o w E r r o r M e s s a g e ( ‘ N o t h i n g t o c a n c e l : no c . time = d a p p o i n t m e n t was f i x e d on ’ + d ) a c c e p t a b l e D a t e s . add ( new I n t e g e r ( c . g e t ( c . DATE) ) ) l o g ( ‘ N o t h i n g t o c a n c e l : no a p p o i n t m e n t was f i x e d on } ’ + d , L o g g e r .WARNING) return e x t r a c t p r o p o s a l a s A c t i o n from msg } var a p p o i n t m e n t = p r o p o s a l . a c t i o n a s A p p o i n t m e n t i f ( ! a p p o i n t m e n t . i n v i t e d P e r s o n s . empty ) { var A c t i o n a c t i o n = new A c t i o n ( ) for ( d : appointment . possibleDates ) { a c t i o n . a c t o r = AID c . time = d action . action = appointment var day = new I n t e g e r ( c . g e t ( c . DATE) ) var r e c e i v e r s L i s t = # [ ] i f ( a c c e p t a b l e D a t e s . c o n t a i n s ( day ) ) for ( p : appointment . invitedPersons ) a c c e p t e d D a t e s . add ( day ) r e c e i v e r s L i s t . add ( p . AID ) } send message { p e r f o r m a t i v e i s CANCEL acceptableDates = acceptedDates . clone o n t o l o g y i s MSOntology i f ( ! a c c e p t a b l e D a t e s . empty ) { r e c e i v e r s are r e c e i v e r s L i s t var d = new D a t e ( ) content i s action var i n t dateNumber = } (( Integer ) acceptableDates . get (0) ) . intValue () } removeMyAppointment ( a p p o i n t m e n t ) c . s e t ( c . DATE , dateNumber ) } pendingApp . s e t F i x e d D a t e ( c . t i m e ) var a c t i o n = new A c t i o n ( ) The roles are completely listed below and all the details a c t i o n . s e t A c t o r ( t h e A g e n t . AID ( ) ) required to define roles are given. Their declarations indicate a c t i o n . s e t A c t i o n ( pendingApp ) 88 c r e a t e message r e p l y M s g { on REJECT PROPOSAL msg { o n t o l o g y i s MSOntology p r i n t l n ( ‘ R e s p o n d e r r e c e i v e d R e f u s e : ’ + msg . t o S t r i n g ( ) ) p e r f o r m a t i v e i s ACCEPT PROPOSAL } r e c e i v e r s a r e # [ msg . s e n d e r ] content i s action Finally, the CancelAppointmentBehaviour is shown in the } } else { following. c r e a t e message r e p l y M s g { c y c l i c behaviour CancelAppointmentBehaviour for p e r f o r m a t i v e i s REJECT PROPOSAL MeetingSchedulerAgent { r e c e i v e r s a r e # [ msg . s e n d e r ] on message msg c o n t e n t i s ‘No d a t e a v a i l a b l e ’ when { } p e r f o r m a t i v e i s CANCEL } } do { } e x t r a c t con a s A p p o i n t m e n t i f ( con . i n v i t e r == t h e A g e n t . AID ) Finally, if the proposal is accepted and the responder succeeds t h e A g e n t . c a n c e l A p p o i n t m e n t ( con . f i x e d D a t e ) else in fixing the appointment, a final message that informs the t h e A g e n t . removeMyAppointment ( con ) initiator is sent. Here the handling of the reception of such } } message is shown. on INFORM msg { var P e r s o n p = t h e A g e n t . getPersonByAgentName ( B. Quantitative Assessment msg . s e n d e r ) As shown in the previous section, JADEL implementation pendingApp . i n v i t e d P e r s o n s . c l e a r i f ( p == n u l l ) of the Meeting Scheduler demo is composed by the same p = new P e r s o n ( msg . s e n d e r . name , n u l l , n u l l ) entities of the JADE version, but it is characterized by specific pendingApp . g e t I n v i t e d P e r s o n s ( ) . add ( p ) t h e A g e n t . addMyAppointment ( pendingApp ) syntax for agent-oriented features. Moreover, the operations } and methods have the same semantics of those in JADE, but Below, the source code of the responder behaviour is listed. some parts are much shorter than the original ones. Beside the In case the responder receives a CFP, it will decide to accept original demo and the JADEL implementation shown above, it or not. we obtained a third Java implementation directly by JADEL code generator. The generated code is more redundant than role myFipaContractNetResponderBehaviour for M e e t i n g S c h e d u l e r A g e n t a s FIPA CONTRACT NET : R e s p o n d e r { the original JADE demo source code, but it does not introduce on CFP msg { significant overhead and the number of messages exchanged e x t r a c t c f p a s A c t i o n from msg var a p p o i n t m e n t = c f p . a c t i o n a s A p p o i n t m e n t by the agents are the same. Hence, there is not a notable var p r o p o s a l = a p p o i n t m e n t performance loss. proposal . possibleDates . clear () for ( d : proposal . possibleDates ) The scope of JADEL is mainly to simplify the use of JADE i f ( theAgent . i s F r e e ( ) ) and to make clear and transparent the agent model. In order to p r o p o s a l . p o s s i b l e D a t e s . add ( d ) i f ( ! p r o p o s a l . p o s s i b l e D a t e s . empty ) { evaluate the actual advantages in use of JADEL, we compare var a = new A c t i o n ( ) the original JADE implementation with our JADEL translation, a . a c t o r = t h e A g e n t . AID a . action = proposal by using two measures based on Lines Of Code (LOC). First, c r e a t e message r e p l y { we consider the total number of non-comment and non-blank p e r f o r m a t i v e i s PROPOSE o n t o l o g y i s MSOntology LOC of the agent, of the ontology, and of the behaviours. r e c e i v e r s a r e # [ msg . s e n d e r ] Then, we emphasize the fraction of domain-specific features content i s a } and expressions over the total number of lines. In JADEL, } else { such domain-specific features are those presented in Section II: c r e a t e message r e p l y { p e r f o r m a t i v e i s REFUSE entity declaration, event handler, message related expressions, r e c e i v e r s a r e # [ msg . s e n d e r ] and behaviours/role activation. For example, in the previously c o n t e n t i s ‘No a v a i l a b l e d a t e ’ } shown listing of CancelAppointmentBehaviour, there are } 12 non-blank LOC and 6 lines of domain-specific features. In } particular, those lines are the first, namely, the entity declara- The initiator can decide to accept or reject a proposal and, in tion, the event handling with the on − when − do construct, both cases, it sends a notification message to the responder. and the extraction of the received message. Thus, the fraction on ACCEPT PROPOSAL msg { of domain-specific features is the 50% of the LOC. In JADE, e x t r a c t a a s A c t i o n from msg we consider as domain-specific all the actual call to the APIs, var a p p o i n t m e n t = a . a c t i o n a s A p p o i n t m e n t i f ( theAgent . i s F r e e ( appointment . fixedDate ) ) { including the lines that identify the base class, i.e., the entity. t h e A g e n t . addMyAppointment ( a p p o i n t m e n t ) From the Table I, we can see that JADEL implementation c r e a t e message r e p l y { p e r f o r m a t i v e i s INFORM is shorter than JADE one. This is particularly evident when } considering the ontology, that consists in only eight non-blank } else { c r e a t e message r e p l y { LOC, in JADEL. Instead, 175 lines are required by the JADE p e r f o r m a t i v e i s FAILURE ontology, which includes also the declaration of two more } } classes that define concepts. Also JADEL behaviours seem to } be simpler than JADE ones, with a little advantage in focusing 89 MSAgent MSOntology Behaviours implementation. Also roles and behaviours are shorter and JADEL (LOCs) 264 8 173 clearer, due to the frequent use of domain-specific constructs, DS/JADEL (%) 20 75 32 especially for message passing. Moreover, the entire code of JADE (LOCs) 305 175 233 the GUI was reused, thanks to the tight integration of JADEL DS/JADE (%) 23 11 20 entities into Java type-system. Table I As previously said, numbers of LOCs and the percentage of N UMBER OF LOC AND PERCENTAGE OF D OMAIN -S PECIFIC (DS) DS-LOCs are not sufficient to measure the actual advantage in FEATURES OVER THE TOTAL NUMBER OF LOC, FOR JADEL AND JADE the use of JADEL. For this reason, future works will address IMPLEMENTATION OF THE M EETING S CHEDULER DEMO . the problems of language evaluation and testing. Such an evaluation could be done by scheduling the development of an application by a team of several users. Users could have on the domain-specific tasks. The number of LOC of JADEL different experiences in the use of JADE, from beginners to agent, instead, is only slightly smaller than that of JADE agent experts. Moreover, making an application that deals with a and domain-specific features are approximately the same. This real-world problem is a good strategy for testing. is due to the point-to-point translation that has been made, in JADEL was not yet released, because it is still under order to reproduce precisely the original demo. As a matter development and its quality, in terms of readability and of fact, we have chosen not to change the demo specification, reusability, still have to be assessed. Anyway, the compiler, in order to make a fair comparison between the two versions. related documentation and examples are freely available open We argue that a revisited and original JADEL implementation source upon request to authors. of the Meeting Scheduler demo may be more focused on behaviours rather than on agent methods, thus improving the R EFERENCES readability of the agent code and reducing its size. [1] F. Bergenti, “An introduction to the JADEL programming language,” However, LOC and domain-specific fraction of those lines in Procs. of the IEEE 26th Int’l Conference on Tools with Artificial are only indicators of size and density of JADEL code, but Intelligence (ICTAI). IEEE, 2014, pp. 974–978. they cannot fully describe qualitative factors, such as the [2] F. Bellifemine, G. Caire, and D. Greenwood, Developing multi-agent systems with JADE. Wiley Series in Agent Technology, 2007. readability of the code, nor how much the code is reusable [3] F. Bergenti and A. Poggi, “Developing smart emergency applications and maintainable. with multi-agent systems,” International Journal of E-Health and Med- ical Communications, pp. 1–13, 2010. IV. C ONCLUSIONS [4] S. Monica and F. Bergenti, “Location-aware JADE agents in indoor scenarios,” in Proceedings of 16th Workshop “Dagli Oggetti agli This paper presents a complete example of JADEL usage, Agenti” (WOA ’15), Napoli, Italy, 2015, pp. 103–108. related to the well-known Meeting Scheduler demo of JADE. [5] S. Monica and F. Bergenti, “A comparison of accurate indoor localization Scope and motivations of JADEL development are briefly of static targets via WiFi and UWB ranging,” in Advances in Intelligent Systems and Computing (PAAMS 2016), Special Session on Agents and explained, then main abstractions, domain-specific features Mobile Devices (AM), 2016. and expressions are introduced. The example is presented [6] F. Bergenti, G. Caire, and D. Gotta, “Interactive workflows with WADE,” by showing JADEL source code of the Meeting Scheduler in Procs. of the 21st IEEE International Conference on Collaboration Technologies and Infrastructures (WETICE 2012), 2012, pp. 10–15. ontology, notable parts of the agent, and all the behaviours. A [7] F. Bergenti, G. Caire, and D. Gotta, “Large-scale network and service comparison between JADE and JADEL implementations of management with WANTS,” in Industrial Agents: Emerging Applica- such a demo is made by counting non-comment and non- tions of Software Agents in Industry, 2015, pp. 231–246. [8] F. Bergenti, G. Caire, and D. Gotta, “Agent-based social gaming with blank LOC and by measuring the rate of domain-specific AMUSE,” in Procs. of the 5th Int’l Conf. Ambient Systems, Networks agent-oriented features over the total number of LOC. These and Technologies (ANT 2014) and 4th Int’l Conf. Sustainable Energy indicators are useful in a first approximation to enlighten Information Technology (SEIT 2014), ser. Procedia Computer Science, vol. 32. Elsevier, 2014, pp. 914–919. some JADEL advantages, namely, its lighter syntax and the [9] F. Bergenti, G. Caire, and D. Gotta, “An overview of the AMUSE social conciseness in the definition of ontologies. Nevertheless, other gaming platform,” in Procs. Workshop From Objects to Agents, 2013. aspects are difficult to be precisely evaluated, due to their [10] F. Bergenti and S. Monica, “Location-Aware Social Gaming with AMUSE,” in Trends in Practical Applications of Scalable Multi-Agent qualitative nature. For instance, some constructs and expres- Systems, the PAAMS Collection (PAAMS 2016), 2016, pp. 36–47. sions are meant to reduce the complexity of the framework [11] K. Kravari and N. Bassiliades, “A survey of agent platforms,” Journal and to improve readability rather than to reduce the amount of Artificial Societies and Social Simulation, vol. 18, no. 1, p. 11, 2015. [12] Y. Shoham, “Agent-oriented programming,” Artificial intelligence, of code written. As illustrative examples, the on − when − do vol. 60, no. 1, pp. 51–92, 1993. and the extract − as are specifically designed to clarify [13] F. Bergenti, M.-P. Gleizes, and F. Zambonelli, Methodologies and message reception, while the corresponding JADE patterns are software engineering for agent systems: the agent-oriented software engineering handbook. Science & Business Media, 2006, vol. 11. repetitive and full of implementation details. [14] F. Bergenti, E. Iotti, and A. Poggi, “Core features of an agent-oriented In summary, JADEL is shown to be sufficiently expressive domain-specific language for JADE agents,” in Trends in Practical to fully reproduce the Meeting Scheduler demo and the best Applications of Scalable Multi-Agent Systems, the PAAMS Collection. Springer, 2016, pp. 213–224. results with respect to JADE are obtained in the ontology 90