RapidPrototypingofLargeMulti-AgentSystemsthroughLogicProgrammingW.Vasconcelos(wvasconcelos@acm.org)DepartmentofComputingScience,UniversityofAberdeenAberdeenAB243UE,UnitedKingdomD.Robertson(dr@inf.ed.ac.uk)CentreforIntelligentSystemsandtheirApplications(CISA)DivisionofInformatics,UniversityofEdinburghAppletonTower,CrichtonStreet,EdinburghEH89LE,UnitedKingdomC.Sierra(sierra@iiia.csic.es),M.Esteva(marc@iiia.csic.es)andJ.Sabater(jsabater@iiia.csic.es)ArticialIntelligenceResearchInstitute(IIIA)ConsejoSuperiordeInvestigacionesCientcas(CSIC)CampusUAB,08193,Bellaterra,Catalonia,SpainM.Wooldridge(mjw@csc.liv.ac.uk)DepartmentofComputerScience,UniversityofLiverpoolLiverpoolL697ZF,UnitedKingdomAbstract.Prototypingisavaluabletechniquetohelpsoftwareengineersexplorethedesignspacewhilegaininginsightonthedynamicsofthesystem.Inthispaper,wedescribeamethodforrapidlybuildingprototypesoflargemulti-agentsystemsusinglogicprogramming.Ourmethodadvocatestheuseofadescriptionofallpermittedinteractionsamongthecomponentsofthesystem,thatis,theprotocol,asthestartingspecication.Theprotocolisrepresentedinawaythatallowsustoautomaticallycheckfordesirablepropertiesofthesystemtobebuilt.Wethenemploythesamespecicationtosynthesiseagentsthatwillcorrectlyfollowtheprotocol.Thesesynthesisedagentsaresimplelogicprogramsthatengineerscanfurthercustomiseintomoresophisticatedsoftware.Ourchoiceofagentsaslogicprogramsallowsustoprovidesemi-automaticsupportforthecustomisationactivity.Inourmethod,aprototypeisaprotocolwithasetofsynthesisedandcustomisedagents.Executingtheprototypeamountstohavingtheseagentsenacttheprotocol.Wehaveimplementedanddescribedadistributedplatformtosimulateprototypes.1.IntroductionRapidprototypingoersameanstoexploreessentialfeaturesofaproposedsystem[9,27,35],promotingearlyexperimentationwithalternativedesignchoicesandallowingengineerstopursuedierentsolutionswithouteciencyconcerns[9].In[25]wendreportsofmanysuccessfulexperimentsofrapidprototyping.Multi-agentsystems(MASs,forshort)arehardertodesignthancentralisedsystems[38]andc2003KluwerAcademicPublishers.PrintedintheNetherlands.main.tex;19/11/2003;9:51;p.12W.Vasconcelosetal.toolsandmethodstosupportthedevelopmentofMASsareinurgentneed[30].InthispaperwedescribeamethodforrapidlybuildingprototypesoflargeMASsusinglogicprogramming.OurapproachisbasedonaglobalprotocoldepictingallinteractionsthattakeplaceintheMAS.Theformatandorderofallinteractionsareformallyspeciedasakindofnon-deterministicnitestatemachine.Thisformalismcanbeusedtocheckfordesirablepropertiesintheprotocol.Anadvantageweexploitisthatthisglobalprotocolcanbeusedtoautomaticallysynthesisetheagentsthatwillcomprisethesystem.OurapproachtoprototypingMASsreectsthemodellingmethodologyintroducedin[61]andconsistsofthefollowingsteps:1.DesignofaGlobalProtocol{inthisinitialstepweprescribethedesignofaglobalprotocol,thatis,aprecisedescriptionofthekindsandorderofmessagesthatthecomponentsoftheMAScanexchange.Forthisdescriptionwehaveusedaformofnon-deterministicnitestatemachines,calledelectronicinstitutions(orsimplye-institutions)[18,40].WeexplainmoreaboutthisinSection2.2.SynthesisandCustomisationofAgents{thisstepaddressestheautomaticsynthesisofagentsaslogicprogramscomplyingwiththeglobalprotocol.Althoughsimple,thesesynthesisedagentsareinstrictaccordancewiththeprotocolfromwhichtheyoriginate:theirbehavioursconformtothespecicationoftheglobalprotocol.ToallowforthevariabilityofthecomponentsofaMASandtohelpengineersexplorethedesignspaceofindividualagents,weoermeanstocustomisethesynthesisedagentsintomoresophisticatedpiecesofsoftware,usinglogicprogramtransformationtechniques.WeexplainthisstepinSection3.3.DenitionofPrototype{aprototypeconsistsofane-institutionandasetofcorrespondingcustomisedagents.Designersmaydelib-eratelyleaveemptyslotsinthecustomisedagentswheredierentdesignpossibilitiesmaybepursued.Theseslotscanbecompleteddierentlygivingrisetodistinctprototypes.InSection4wede-scribethisstep.4.SimulationandMonitoringofthePrototype{thelaststepisthesimulationoftheprototypeandthecollectionofresults.Weoermeansfortheenactmentofanelectronicinstitution:theagentsarestartedasself-containedandasynchronousprocessesthatcom-municatebymeansofmessage-passing.ThisstepisdescribedinSection5.main.tex;19/11/2003;9:51;p.2RapidPrototypingofLargeMASsthroughLogicProgramming3ThesestepsareillustratedinFigure1.Inthediagram,wealsoincludedsimulationMASprototypedefinitionofsynthesis&customisationResultsAgentGlobalProtocolResultsverificationFigure1.OverviewofProposedMethodforRapidPrototypingavericationactivity:thesamespecicationfortheglobalprotocolcanbeusedtocheckfordesirableproperties(ortheabsenceofundesirableproperties){weexplainthisstepinSection2.WedescribethestepsaboveinSections2to5.WecompareourapproachwithrelatedworkinSection6andinSection7wediscusstheideaspresented,drawconclusionsandgivedirectionsforfuturework.1.1.ATypicalScenarioforMASPrototypingMASsconsistofmanycomponentswhichinteractdynamically,eachwithitsownthreadofcontrol,andengagingincomplexcoordinationprotocols.MASsarem