Developing Multi-Agent Systems with JADE
Total Page:16
File Type:pdf, Size:1020Kb
Developing Multi-Agent Systems with JADE Wiley Series in Agent Technology Series Editor: Michael Wooldridge, Liverpool University, UK The ‘Wiley Series in Agent Technology’ is a series of comprehensive practical guides and cutting- edge research titles on new developments in agent technologies. The series focuses on all aspects of developing agent-based applications, drawing from the Internet, telecommunications, and Artificial Intelligence communities with a strong applications/technologies focus. The books will provide timely, accurate and reliable information about the state of the art to researchers and developers in the Telecommunications and Computing sectors. Titles in the series: Padgham/Winikoff: Developing Intelligent Agent Systems 0470861207 (June 2004) Pitt (ed.): Open Agent Societies 047148668X (August 2004) Developing Multi-Agent Systems with JADE Fabio Bellifemine, Telecom Italia, Italy Giovanni Caire, Telecom Italia, Italy Dominic Greenwood, Whitestein Technologies AG, Switzerland Copyright 2007 John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England Telephone (+44) 1243 779777 Email (for orders and customer service enquiries): [email protected] Visit our Home Page on www.wiley.com All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except under the terms of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road, London W1T 4LP, UK, without the permission in writing of the Publisher. Requests to the Publisher should be addressed to the Permissions Department, John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England, or emailed to [email protected], or faxed to (+44) 1243 770620. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the Publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services of a competent professional should be sought. JADE () and related logos are a registered trademark of Telecom Italia S.p.A. Other Wiley Editorial Offices John Wiley & Sons Inc., 111 River Street, Hoboken, NJ 07030, USA Jossey-Bass, 989 Market Street, San Francisco, CA 94103-1741, USA Wiley-VCH Verlag GmbH, Boschstr. 12, D-69469 Weinheim, Germany John Wiley & Sons Australia Ltd, 42 McDougall Street, Milton, Queensland 4064, Australia John Wiley & Sons (Asia) Pte Ltd, 2 Clementi Loop #02-01, Jin Xing Distripark, Singapore 129809 John Wiley & Sons Canada Ltd, 6045 Freemont Blvd, Mississauga, ONT, L5R 4J3, Canada Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Anniversary Logo Design: Richard J. Pacifico Library of Congress Cataloging-in-Publication Data: Bellifemine, Fabio. Developing multi-agent systems with JADE / Fabio Bellifemine, Giovanni Caire, Dominic Greenwood. p. cm. Includes bibliographical references and index. ISBN-13: 978-0-470-05747-6 (cloth : alk. paper) 1. Intelligent agents (Computer software) 2. Object-oriented programming (Computer science) 3. Java (Computer program language) I. Caire, Giovanni. II. Greenwood, Dominic. III. Title. QA76.76.I58B45 2007 006.3–dc22 2006036200 British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library ISBN: 978-0-470-05747-6 (HB) Typeset in 9/11pt Times by Laserwords Private Limited, Chennai, India Printed and bound in Great Britain by Antony Rowe Ltd, Chippenham, Wiltshire This book is printed on acid-free paper responsibly manufactured from sustainable forestry in which at least two trees are planted for each one used for paper production. Contents The Authors ix List of Contributors xi Preface xiii 1 Introduction 1 2 Agent Technology Overview 3 2.1 About agents 3 2.2 The Foundation for Intelligent, Physical Agents (FIPA) 10 3 The JADE Platform 29 3.1 Brief history 29 3.2 JADE and the agents paradigm 30 3.3 JADE architecture 32 3.4 Compiling the software and launching the platform 34 3.5 JADE packages 37 3.6 Message transport service 39 3.7 Admin and debugging tools 42 4 Programming with JADE – Basic Features 51 4.1 Creating agents 51 4.2 Agent tasks 57 4.3 Agent communication 65 4.4 Agent discovery: the yellow pages service 72 4.5 Agents with a GUI 75 5 Programming with JADE – Advanced Features 77 5.1 Ontologies and content languages 77 5.2 Composing behaviours to create complex tasks 91 5.3 Threaded behaviours 99 5.4 Interaction protocols 100 5.5 Interacting with the AMS 107 5.6 Starting JADE from an external Java application 111 6 Agent Mobility 115 6.1 Agent mobility 115 6.2 Intra-platform mobility 117 6.3 Inter-platform mobility service 119 6.4 Usage of the JADE mobility services 121 vi Contents 7 JADE Internal Architecture 131 7.1 Distributed coordinated filters 131 7.2 Creating a JADE kernel service 136 8 Running JADE Agents on Mobile Devices 145 8.1 Main limitations of the mobile environment 145 8.2 The LEAP add-on 146 8.3 The split container execution mode 150 8.4 Developing MIDP agents 154 8.5 LEAP add-on advanced 161 9 Deploying a Fault-Tolerant JADE Platform 173 9.1 The main replication service 173 9.2 Attaching the DF to a relational DB 176 10 The JADE Web Services Integration Gateway 181 10.1 Web service technology 181 10.2 The utility of agent and Web service integration 182 10.3 The WSIG architecture 182 10.4 Installation requirements 184 10.5 WSIG installation procedure 185 10.6 WSIG operation 186 10.7 Example 1: Web service client invokes an agent service 193 10.8 Example 2: Agent service invokes a Web service 203 11 Agent-Society Configuration Manager and Launcher 207 11.1 Basic terms and concepts 207 11.2 Book-trading example 209 11.3 Distributed deployment 215 11.4 The XML meta-model 218 11.5 Inside the ASCML 220 11.6 Distributed monitoring, logging and debugging 222 11.7 Outlook 223 12 JADE Semantics Framework 225 12.1 FIPA-SL language 226 12.2 Interpretation engine 230 12.3 Basic semantic agent 231 12.4 Specializing the interpretation activity 234 12.5 Customizing belief handling 237 12.6 Handling Actions 240 12.7 Synthesizing standard and advanced use of the JSA 245 12.8 Conclusions 245 13 A Selection of Other Relevant Tools 247 13.1 The Bean Generator 247 13.2 JADEMX 250 13.3 The Java Sniffer 251 13.4 JADEX – engineering goal-oriented agents 254 Contents vii APPENDIX A Command Line Options 259 A.1 Syntax 259 A.2 Options to launch containers and main containers 260 A.3 General Options 261 A.4 Options of the JADE kernel-level services 262 A.5 Options related to MTPs 265 A.6 Options to configure the yellow page DF service 267 A.7 Options specific to the JADE-LEAP platform 268 A.8 Extending the command line with user-defined options 269 APPENDIX B List of Symbols and Acronyms 271 Bibliography 275 References 275 FIPA Specifications 278 Index 281 The Authors Fabio Bellifemine is a senior project manager at the Research Labs of Telecom Italia. He inspired, originated and led the JADE Project and, later, he launched and presided at the JADE Governing Board. He graduated summa cum laude from the Computer Science University of Torino in 1988 and, before joining Telecom Italia (formerly CSELT), until 1994 he was a researcher at the Italian National Research Council (CNR) working in the field of digital video coding. In 1996 he joined the FIPA standardization body and he was attracted by the software agent technology. In 2000, on behalf of the Work Package 1 of the FACTS Project, he was awarded the first prize in the FIPA competition for the best agent-based application: ‘New generation TV entertainment system’. He served as chairman of the FIPA Architecture Board and, next, of the X2S Technical Committee with the challenging goal of promoting to standard the core specifications of FIPA. The effort and the passion for this emerging technology were recognized by appreciation certificates of FIPA for his outstanding contributions. He is IEEE Senior Member, member of the Technical Committee on Distributed Intelligent Systems of the IEEE Systems, Man, and Cybernetics Society, and member of the Program Committee of some scientific conferences in this research field. He is also member of the Expert Group of JSR 271 which is going to specify the third generation of Java MIDP specifications. His research interests mainly focus on agent technologies and on their adoption to develop better and more efficient systems and applications; recently, he launched in Telecom Italia a new research program in the field of Wireless Sensor Networks. Giovanni Caire graduated summa cum laude from the Politecnico di Torino in 1992 and, after that, joined the Research Labs of Telecom Italia (formerly CSELT) where he is now a senior project manager. He started working in the Multimedia and Video Services department where he was involved in several international collaborative projects. In 1995 he led the ATMAN ACTS European Project dealing with advanced techniques of audio-visual content trading. Since 1998 his interest has been in the field of distributed applications with particular focus on the Java technology. He started working in the JADE Project in 2000 when he led the working group that ported the platform on the Java Micro Edition within the scope of the LEAP IST European Project. In 2004 he represented Telecom Italia in the Java Workstream of the OMTP international initiative whose goal was to define an open platform on mobile terminals enabling service providers to develop a uniform and simplified customer experience.