Programming Multi-Agent Systems in AgentSpeak using Jason Wiley Series in Agent Technology SeriesEditor:MichaelWooldridge,UniversityofLiverpool,UK The‘WileySeriesinAgentTechnology’isaseriesofcomprehensivepracticalguidesand cutting-edgeresearchtitlesonnewdevelopmentsinagenttechnologies.Theseriesfocuses onallaspectsofdevelopingagent-basedapplications,drawingfromtheInternet, Telecommunications,andArtificialIntelligencecommunitieswithastrong applications/technologiesfocus. Thebookswillprovidetimely,accurateandreliableinformationaboutthestateofthe arttoresearchersanddevelopersintheTelecommunicationsandComputingsectors. Titlesintheseries: Padgham/Winikoff:DevelopingIntelligentAgentSystems0470861207(June2004) Bellifemine/Caire/Greenwood:DevelopingMulti-AgentSystemswithJADE 978-0-470-05747-6(February2007) Programming Multi-Agent Systems in AgentSpeak using Jason Rafael H. Bordini UniversityofDurham,UK Jomi Fred Hübner UniversityofBlumenau,Brazil Michael Wooldridge UniversityofLiverpool,UK Copyright(cid:148)2007 JohnWiley&SonsLtd,TheAtrium,SouthernGate,Chichester, WestSussexPO198SQ,England + Telephone( 44)1243779777 Email(forordersandcustomerserviceenquiries):[email protected] VisitourHomePageonwww.wileyeurope.comorwww.wiley.com AllRightsReserved.Nopartofthispublicationmaybereproduced,storedinaretrievalsystemor transmittedinanyformorbyanymeans,electronic,mechanical,photocopying,recording, scanningorotherwise,exceptunderthetermsoftheCopyright,DesignsandPatentsAct1988or underthetermsofalicenceissuedbytheCopyrightLicensingAgencyLtd,90TottenhamCourt Road,LondonW1T4LP,UK,withoutthepermissioninwritingofthePublisher.Requeststothe PublishershouldbeaddressedtothePermissionsDepartment,JohnWiley&SonsLtd,The Atrium,SouthernGate,Chichester,WestSussexPO198SQ,England,oremailedto + [email protected],orfaxedto( 44)1243770620. Designationsusedbycompaniestodistinguishtheirproductsareoftenclaimedastrademarks.All brandnamesandproductnamesusedinthisbookaretradenames,servicemarks,trademarksor registeredtrademarksoftheirrespectiveowners.ThePublisherisnotassociatedwithanyproduct orvendormentionedinthisbook.Alltrademarksreferredtointhetextofthispublicationarethe propertyoftheirrespectiveowners. Thispublicationisdesignedtoprovideaccurateandauthoritativeinformationinregardtothe subjectmattercovered.ItissoldontheunderstandingthatthePublisherisnotengagedin renderingprofessionalservices.Ifprofessionaladviceorotherexpertassistanceisrequired,the servicesofacompetentprofessionalshouldbesought. OtherWileyEditorialOffices JohnWiley&SonsInc.,111RiverStreet,Hoboken,NJ07030,USA Jossey-Bass,989MarketStreet,SanFrancisco,CA94103-1741,USA Wiley-VCHVerlagGmbH,Boschstr.12,D-69469Weinheim,Germany JohnWiley&SonsAustraliaLtd,42McDougallStreet,Milton,Queensland4064,Australia JohnWiley&Sons(Asia)PteLtd,2ClementiLoop#02-01,JinXingDistripark,Singapore129809 JohnWiley&SonsCanadaLtd,6045FreemontBlvd,Mississauga,Ontario,L5R4J3,Canada Wileyalsopublishesitsbooksinavarietyofelectronicformats.Somecontentthatappears inprintmaynotbeavailableinelectronicbooks. AnniversaryLogoDesign:RichardJ.Pacifico LibraryofCongressCataloging-in-PublicationData Bordini,RafaelH. Programmingmulti-agentsystemsinAgentSpeakusingJason/RafaelH. Bordini,JomiFredHŸbner,MichaelWooldridge. p.cm. Includesbibliographicalreferences. ISBN978-0-470-02900-8(cloth) 1. Intelligentagents(Computersoftware)2. Computerprogramming. I.Hübner,JomiFred.II.Wooldridge,MichaelJ.,1966-III.Title. QA76.76.I58B672007 006.3(cid:1)3−dc22 2007021099 BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary ISBN 978-0-470-02900-8(HB) Typesetin11/13.6ptGaramondbyLaserwordsPrivateLimited,Chennai,India PrintedandboundinGreatBritainbyAntonyRoweLtd,Chippenham,Wiltshire Thisbookisprintedonacid-freepaperresponsiblymanufacturedfromsustainableforestry inwhichatleasttwotreesareplantedforeachoneusedforpaperproduction. ToIdahyr(inmemoriam),Maria,Ricardo,Lizete,Roberto,Renato,Rubens, LilianeandThays. (RHB) ToIlze,MorganaandThales. (JFH) ToLilyMayandThomasLlewelyn. (MW) Contents Preface xi Acknowledgements xvii 1 Introduction 1 1.1 AutonomousAgents . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 CharacteristicsofAgents . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Multi-AgentSystems . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4 HelloWorld! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 The BDIAgent Model 15 2.1 Agent-OrientedProgramming . . . . . . . . . . . . . . . . . . . . 15 2.2 PracticalReasoning . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3 AComputationalModelofBDIPracticalReasoning . . . . . . . . 20 2.4 TheProceduralReasoningSystem . . . . . . . . . . . . . . . . . . 22 2.5 AgentCommunication . . . . . . . . . . . . . . . . . . . . . . . . 25 3 The Jason Agent ProgrammingLanguage 31 3.1 Beliefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.2 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.3 Plans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.4 Example:ACompleteAgentProgram . . . . . . . . . . . . . . . . 58 3.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4 Jason Interpreter 67 4.1 TheReasoningCycle . . . . . . . . . . . . . . . . . . . . . . . . . 67 4.2 PlanFailure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 4.3 InterpreterConfigurationandExecutionModes . . . . . . . . . . 93 4.4 Pre-DefinedPlanAnnotations . . . . . . . . . . . . . . . . . . . . 97 4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Description: