Vidal Computer Science and Engineering University of South Carolina Columbia SC 29208 vidalscedu Paul Buhler Computer Science College of Charleston 66 George Street Charleston SC 29424 pbuhlercscofcedu Abstract We describe our experiences using the ID: 61690
Download Pdf The PPT/PDF document "Teaching Multiagent Systems using RoboCu..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
(a)Anygoodplayerwillneedtoparsethesensorinputandcreateitsownworldmapwhichusesabsolutecoordinates.Thatis,theinputtheagentsreceivehastheobjects'coordinatesasrelativepolarcoor-dinatesfromtheplayer'scurrentposition.Whilerealistic,thesearehardtouseinthedenitionofbehaviors.Therefore,asophisticatedplayerwillneedtoturnthemintogloballyabsolutecoordi-nates.(b)Theplayersneedtoimplementseveralsophisti-catedgeometricfunctionsthatanswersomebasicquestionslike:\WhoshouldIbeabletoseenow?"(c)Theplayersalsoneedtoimplementfunctionsthatdeterminetheargumentvaluesfortheircommands.Forexample:\HowhardshouldIkickthisballsothatitwillbeatcoordinatesx;ynexttime?"2.Itishardtokeepsynchronizedwiththesoccerserver'supdateloop.Specically,theplayershavetomakesuretheysendoneandonlyoneactionforeachclock\tick."Sincethesoccerserverisrunningonadif-ferentmachine,theplayerhastomakesureitkeepssynchronizedanddoesnotmissactionopportunities,evenwhenmessagesarelost.3.Studentsnewtoagentdesignneedsomeguidanceinestablishingabasicagentarchitecture.Theylackex-perienceusingtechniquesforbalancinggoal-drivenandreactivebehaviors.ThesedrawbacksforcedstudentstospendmostoftheirtimewritingcodetohandletheUDPmessageparsingandtheconstructionofaworldmodel,aswedetailinSection6.Therefore,wedesignedabasicRoboCupclient,calledBiter,thatimplementsallthefeaturesthestudentswillneedinordertoquicklygetstartedtestingnewbehaviorsandcoordinationprotocols.5TheBiterPlatformBiterprovidesitsuserswithanabsolute-coordinateworldmodel,asetoflow-levelballhandlingskills,asetofhigher-levelskillbasedbehaviors,andourGenericAgentArchitecture(GAA)[14]whichformstheframe-workforagentdevelopment.Additionally,manyfunc-tionalutilitymethodsareprovidedwhichallowuserstofocusmoredirectlyonplanningactivities.Biteriswrit-teninJava2.AcompletedescriptionofBiter,itssourcecode,JavadocAPI,andUMLdiagramsareavailable[1].5.1Biter'sWorldModelIntheRoboCupdomainithasbecomeclearthatagentsneedtobuildaworldmodel[12].TheBiterworldmodelcontainsslotsforbothstaticanddynamicob-jects.Staticobjectshaveaeldplacementthatdoesnotchangeduringthecourseofagame.Theseinclude ags,lines,andthegoals.Incontrast,dynamicobjectsmoveabouttheeldduringthegame.Theseincludetheplayersandtheball.Aplayerreceivessensoryin-put,relativetohiscurrentposition,consistingofvectorsthatpointtothestaticanddynamicobjectsinhiseldofview.Sincestaticobjectshavexedlocations,theyareimportantincalculatingaplayer'sabsoluteposi-tionontheeldofplay.Ifaplayerknowshisabsolutelocation,therelativepositionsofthedynamicobjectsinthesensoryinputcanbetransformedintoabsolutelocations.AssensoryinformationaboutdynamicobjectsisplacedintoBiter'sworldmodelitistimestampedandtheworldmodelisupdated.Werstcalculatetheplayer'sabsolutepositionusingsomeofthecloseststaticob-jectsasguide.Wethenusetheplayer'spositiontocalculatetheabsolutepositionofalldynamicobjects.Allinformationisdiscardedafteritsageexceedstheuser-denedlimit.Userscanexperimentwiththislimit.Asmallvalueleadstoapurelyreactiveagent,alargevalueleadstotheagentseeing\ghosts"ofplayersthatarenotthereanymore.Accesstoworldmodeldatashouldbesimple;however,approachingthisextractionproblemtoosimplisticallyleadstoundesirableclutteringofcode.Thiscodeobfus-cationoccurswithaccessstrategiesthatlitterloopandtestlogicwithineveryroutinethataccessestheworldmodel.Biterutilizesadecoratorpattern[5]whichisusedtoaugmentthecapabilitiesofJava'sArrayListit-erator.Theunderlyingtechniqueusedisthatofal-teringiterator.Thislteringiteratortraversesanotheriterator,onlyreturningobjectsthatsatisfyagivencri-teria.Biterutilizesregularexpressionsfortheselectioncriteria.Forexample,dependingonproximity,thesoc-cerball'sidentityissometimesreportedas\ball"andothertimesas\Ball".Ifourprocessingalgorithmcallsfortheretrievalofthesoccerballfromtheworldmodel,wewouldinitializethelteringiteratorwiththecrite-ria[bB]alltoreliablylocatetheobject.Sincethel-teringcriterionisregularexpressionbased,weareabletoconstructpowerfulextractionroutineswithoutin-curringthecomplexityofcodingerror-pronecompoundconditionals.Althoughaccesstotheworldmodelhasbeenstream-lined,creatingmoreconciseandalgorithm-revealingcode,itremainsdiculttofullyunderstandthebe-havioroftheplayers.Attimesitseemstheonlywaytounderstandmomentsofunexplainablebehavioristohaveaccesstotheplayer'sworldmodel.Dumpingthecontentsoftheworldmodeltoaleforlaterinterpreta-tionisunnecessarilycomplexandunwieldy.Toattackthisproblem,Biterprovidesarun-timevisualdisplayofaplayer'sinternalviewofhisenvironment.When aBiteragentisstarted,acommand-lineparameterisusedtoenablethegraphicaldisplayoftheworldmodel.Thedisplayisservedbyanindependentthreadanduti-lizesdoublebueringforsmoothanimation.Theover-headviewoftheeldshowsallstaticobjectsandthedynamicobjectscurrentlyfoundintheplayer'sworldmodel.Wheneverstaleelementsareencountered,analgorithmisrunwhichmergesitsdisplaycolorwiththebackgroundcoloroftheeld.Visually,thishastheef-fectofhavingstaleelementsfadeawayastheyage.Thegraphicaldisplayofaplayer'sworldmodelcanbecom-paredtothesoccermonitor'sdisplayforpurposesofindependentvericationandvalidationoftheplayer'sworldmodelcontents.Thispowerfuldebuggingfeaturehassaveduserscountlesshoursoffruitlesstroubleshoot-ingandhelpsthemfocusonothermultiagentsystemimplementationissues.5.2TheGenericAgentArchitecturePractitionersnewtoagent-orientedsoftwareengineer-ing[7]oftenstumblewhenbuildinganagentthatneedsbothreactiveandlong-termbehaviors,usuallysettlingforacompletelyreactivesystemandignoringmulti-stepbehaviors.Forexample,inRoboCupanagentcantakeanactionateveryclocktick.Thisactioncansimplybeareactiontothecurrentstateoftheworld,oritcanbedictatedbyalong-termplan.Simpleagentimplemen-tationschooseanactionateachtimestepbyexecutingalongseriesofif-thenstatementswheretheconditionalonlychecksthevalueofrecentinputs.Unfortunately,suchimplementationsmakeitveryhardtoaddmulti-stepbehaviors.Theusualstrategyistoadda\mode"totheagentwhichisthenusedintheconditionalpartoftheif-thenstatementstodeterminewhichactiontotake.Thisstrategy,whilefunctional,isnotveryelegant(itisnotanobject-orientedsolution)anddoesnotscalewellwiththenumberofmulti-stepbehaviors.BiterimplementsaGAAwhichprovidesthestructureneededtoguideusersinthedevelopmentofasolidobject-orientedagentarchitecture.TheGAAisde-signedforagentsthatreceiveinputfromtheenviron-mentatdiscreteintervalsandtakediscreteactions.Thatis,weenvisionanagentthatreceivesreadingsfromitssensorsandtakesactionsusingitseectors.Thisisacommonmethodformodelingautonomousagents[15,Chapter1]andcapturesmanyagentapplications.TheGAAprovidesamechanismforschedulingactivi-tieseachtimetheagentreceivessomeformofinput.Anactivityisdenedasasetofactionstobeperformedovertime.Theactionchosenatanyparticulartimemightdependonthestateoftheworldandtheagent'sinternalstate.Thetwotypesofactivitieswehavede-nedareconversationsandbehaviors.Conversationsareseriesofmessagesexchangedbetweenagents.Be-haviorsareactionstakenoveraseriesoftimesteps.TheActivityManagerdetermineswhichactivityshouldbecalledtohandleanynewinput.AgeneraloverviewofthesystemcanbeseeninFigure2.Anagentispropelledtoactonlyafterreceivingsomeformofinput.Thatis,aftertheactivitymanagerre-ceivesanewobjectoftheInputclass.Thisclasshasthreesub-classes:SensorInput,Message,andEvent.ASensorInputisasetofinputsthatcomedirectlyfromtheagent'ssensors.Biterprovidesaparsingfunc-tionthattransformstheinputfromitsoriginalformat|alist|intoanobjectofthisclass.Inmostimplemen-tationsaclasshierarchyshouldbecreatedunderthisclassinordertodierentiatebetweenthevarioustypesofsensorinputs.BiterdenesObjectInfoandObject-InfoContainerasextensionsofthisclass.TheMessageclassrepresentsamessagefromanotheragent.Robocupplayerscanuseaabroadcastmechanism(\say")tosendmessagestoallnearbyplayers.Finally,theEventclassisaspecialformofinputthatrepresentsaneventtheagentitselfcreated.Eventsfunctionasalarmssettogooatacertaintime.Theyareimportantbecausetheyprovideawaytoimplementtimeouts.Timeoutsareusedwhenwaitingforareplytoamessage,whenwaitingforsomeinputtoarrive,orwhenrepeatedlytakinganactioninthehopeofgeneratingsomeeect.BiterimplementsaspecialinstanceofEventwhichwecalltheactevent.Thiseventreswhenthetimewin-dowforsendinganactiontothesoccerserveropens.Thatis,ittriestoreevery100ms,inaccordancewiththesoccerserver'smainloop.Sincethemessagesbe-tweenBiterandthesoccerservercanbedelayed,andtheirclockscangetskewedovertime,theactualringtimeoftheacteventneedstobeconstantlymonitored.Biterusesanalgorithmsimilartotheoneusedin[12]forkeepingtheseeventssynchronizedwiththesoccerserver.TheActivityclassrepresentsourbasicbuildingblock.Biteragentsaredenedbycreatinganumberofactiv-itiesandlettingtheactivitymanagerschedulethemasneeded.TheActivityclasshasthreemainmemberfunctions:canHandle,handle,andinhibits.ThecanHandlememberfunctionreceivesaninputob-jectasanargumentandreturnstrueiftheactivitycanhandletheinput,thatis,ifitcanexecuteasaconse-quenceofreceivingthatinput.Thisfunctioncouldnotonlyconsiderthecontentsoftheinput,butitcouldalsoconsidertheagent'scurrentinternalstate,theagent'sworldmodel,etc.Sincethisisagenericframework,wedonotconstrainthecanHandlefunctiontoonlyaccessacertainsubsetoftheavailabledata.Thatdecisionislefttothesoftwareengineerwhowantstorenethearchitecture.Theonlyrequirementwemakeisforthefunctiontobespeedysinceitwillneedtobecalledafter anyotheractivity),toastaticorganization(activitiesinhibitaxedtypeofactivities),toadynamicorgani-zation(activitiesinhibitbasedonmanyotherfactors).Asanagentmatures,theusercanchoosetoincreasetheorganizationalcomplexitywithoutre-implementingthearchitecture.AllagentimplementationsthatextendBitermustfol-lowaseriesofsteps.Firsttheagentmustinstantiateanactivitymanagerobject.Theagentthenaddsthedesiredactivitiestothisobject.Thesearetheactivi-tiesthatdeneitsoverallbehavior.Itthencallstherunmethodontheactivitymanagerinordertostartitrunning.Atthispointthemanagertakescompletecon-trolandenteritsinniteloop,choosingwhichbehaviortoexecuteeverytime.Ingeneral,theusershouldnotneedtomodifythemanager.Allthecontrolknowl-edgeisstoredinthecanHandleandinhibitsmethodswhicharedenedbytheuser.6ExperienceswithBiterTheUniversityofSouthCarolinahastaughtagraduate-levelcourseinmultiagentsystemsforseveralyears.TheRoboCupsoccersimulationproblemdomainwasrstadoptedforinstructional,project-basedusefortheSpring2000semester.Studentsaredividedintogroupsoftwoorthree,andeachgroupdesignsandimple-mentsaRoboCupteam.Allgroupsmustwriteare-portontheirworkandduringthenalweekofclassesparticipateinaclasstournament.Wemadeitclearthatagroup'sperformancedoesnotdirectlyaecttheirgrade.However,wecuriouslynotethatthegroupsof-tenseemedmoremotivatedbytheirdesiretowinthetournamentthantoachieveabettergradeintheclass.IntheSpring2000semesterwegavestudentsaveryba-sicJavaclientwhoseonlyfunctionalitywastheabilitytoparseandexchangemessageswiththesoccerserver.WealsomadeavailabletothemthesourcecodefortheCMUnitedteam[12],authoredatCarnegieMellonandwrittenin'C'.TheCMUnitedteamhadwonthepre-vioustwointernationalRoboCupcompetitions.DuetothecomplexityoftheCMUcode,thestudentsunani-mouslychosetousethesimpleJavaclientastheirbasicframeworkandtoperusetheCMUnitedcodeforideas.Thenalresultsfortherstsemesterwereencouraging.Allgroupswereabletobuildworkingteamsandpartici-pateinthenaltournament.Theirstrategies,however,didnotre ectthecoordinationprotocolsorbehaviorse-lectionandplanningalgorithmswehadstudiedinclass.Severalgroupsresortedtoasimple\everyonegototheballandtrytokickittowardsthegoal"strategy.Infact,itwasthisstrategywhichwonthetournament.Acoupleofgroupsimplementedveryrudimentary\zone"strategies,butthesewereincomplete.Forexample,aplayerdribblingtheballtowardsthegoalwouldsud-denlystopwhenitreachedtheendofitszone.More-over,thecodewrittenbymanyofthegroupslackedanystructureddesignandresortedtotheuseofonelargenestedif-then-elsestatement.Thatis,thestudentsdidnotdoathoroughjobatimplementinganyoftheagentarchitecturesdescribedinclass.Webelievethatpartofthereasonforthislastomissionwasthelackofwell-documentedobject-orienteddesignsforagentarchitectures.Ourtextbook[15]describesthearchitecturesusingveryhigh-levelboxdiagrams.ThreequartersintothesemesterweattemptedtoremedythisproblembyprovidingthestudentswithasetofUMLagentarchitectures1butbythenitwastoolate.Thegroupswerealreadytoocommittedtotheirowndesignstopayattentiontoabetteralternative.Asaresultoftheseexperiences,wedevelopedBiterwiththeexpectationthatitwouldallowthestudentgroupstoconcentratemoreonusingthecoordinationstrate-giesstudiedinclassandhelpthemdevelopgoodagentdesigns.DuringtheFall2000semesterthestudentsweregiventheversionofBiterdescribedinSection5,withadefaultbehaviorofgoingtotheballanddribblingittowardsthegoal.Thelastproblemsetbeforethenalcompeti-tionaskedthestudentstoimplementateamthatcouldbeatateamofBiteragentswiththedefaultbehavior.Allgroupswereabletoachievethisgoal,withvaryingdegreesofsuccess.Theresultsofthesecondtournamentwereimpressive.Alloftheteamsimplementedcomplexstrategies.Manyoftheteamsutilized exiblezones,stigmergy[8],andbroadcastcommunications.Forexample,somegroupswereabletohavetheplayersswitchbetweenasetofmodesthatdeterminedtheoverallstrategybeingused(e.g.,aggressiveversusprotective).Theplayerswouldachievethiswithoutanyexplicitcommunication,usingonlycuesfromtheenvironment,therebyimplementingaformofstigmergy.Anexampleofcommunicationem-ployedbyseveralteamswashavingaplayerannounceitspass.Thatis,aplayerwouldshout\IampassingtoP3"justbeforemakingthepass.Alltheotherplayers,especiallyP3,thatheardtheannouncementcouldthenbehaveaccordingly.Thequalityoftheresultingarchitecturesalsoimproved.Theplayercodewasnolongeralongandhardtoun-derstandif-thenstatementwithglobalmodevariables.Instead,thegroupsencapsulatedbehaviorfunctionalityinthevariousbehaviorclasses.Thebehaviortousewaschosenbasedonsomepre-determinedmethodsuchasthepriorityofthebehaviororbasedoncertainfeatures 1Availableathttp://www.multiagent.com/arch/ ofthecurrentworldstate.Thisnewmodularityalsoallowedthegroupstoquicklytestnewbehaviorcom-binationsandrejectbehaviorsthatactuallyresultedinworseteamperformance.Webelievethatthis exibilitycontributedtothequalityofthenalteams.IntheFallof2001classweagainusedthesameBitercode,thistimewithafewnewlow-levelbehaviorsandbug-xes.Onceagainwenoticedimprovementsintheteamperformance,albeitnotasdrasticastheprevi-ousyear.Alltheteamsexhibitedtrueteambehavior.Theyengagedinalotofpassingand,onoccasion,hadpasssequencesthatinvolvedthreeplayers|fromrst,tosecond,tothird,tothegoal.Overallthestudents'experiencescontinuedtobepositive.Therewerestill,however,someareasleftforimprove-ment.Theteamsshowedapoorabilitytoresolvedead-locks.Forexample,sometimesseveralplayersfromthesameteamwouldalltrytotakecontroloftheballatthesametime,annullingeachother'sactionsinthepro-cess.Ingeneral,thestrategieswerebrittleinthattheywouldstopworkingevenaftersmallchangesweremadetothesoccerserverparameters.Finally,thereal-timeperformanceoftheteamswasstillnotuptoparwiththatofcompetitionteams|theyweremissingactionandcoordinationopportunities.7ConclusionsOurexperiencesusingRoboCupandBiterhaveproventousthattheseareeectivetoolsforteachingstudentshowtobuildmultiagentsystems|encouragingthemtodevelopadistributedmindset.Thestudentsoftencom-mentedhowthebuildingofteamswasmuchharderthantheyinitiallyanticipated|rearmingourbeliefthattheyhadnotconsideredthecomplexitiesinvolvedinbuildingamultiagentsysteminanoisyenvironment.Theirnalsuccesses,ontheotherhand,conrmedtousthattheyhadlearnedhowtosuccessfullytacklemanyoftheproblems.OuranalysisoftheircodealsoconrmedthatBiterhadencouragedmostgroupstousepropersoftwareengineeringtechniques.Afterthreeyearsofus-ingRobocuptoteachmultiagentsystemswefeelsthatwehavelearnedafewvaluablelessons.Robocupisanexcellentmotivator.Thequalityofthestudents'nalprojectswasbetterthanonothersimilarprojectswheretheonlyrewardwasagoodgrade.Thebestperformingteamsonthetournamentalwayshavebetterdesignsandarebuiltbythebetterpro-grammers.Thatis,wehaveneverseenabadlyde-signedteamwinordowellonthetournament.Studentsinvariablyunderestimatethedicultyofachievingcoordinatedteambehavior.Wesurmisethatthisignorancecontributestotheirearlyeager-nesstostartbuildingateam.Eventhebestteamsarebrittle|smallchangesinthegameparameters(e.g.,windspeed,noise,etc.)breakthem.Thisistobeexpectedsinceengineeringro-bustnessremainsanopenresearchproblem.Thereisanobsessionwithresponsetime,evenwhenitisalreadygoodenough.ManygroupswouldspendtimeoptimizingthespeedoftheBitercodeevenifthisdidnotactuallychangetheperformanceoftheirteaminanyway.2Webelievethatthisbehaviorarisesbecausethestudentsknowhowtomakeprogramsfaster,sotheyfocusonapplyingthosetechniquesin-steadoffocusingonachievingcoordination,whichistheonlywaytoimprovetheirteamperformance.AlthoughourexperienceswithRoboCupandBiterhavebeenatthegraduatelevel,wefullyexpectthattheywillbeusefultoolsforundergraduateeducation.TheSTEELMANdraftoftheComputingCurricula2001(CC2001)recognizesthatdistributedsystemstopicsneedtobeintroducedwithmorerigorinanunder-graduateCSEeducation.TopicsrelatedtodistributedsystemsarepresentineachofthefollowingCSbodyofknowledgecoreareas,asdenedinCC2001:AlgorithmsandComplexity,ArchitectureandOrganization,Op-eratingSystems,IntelligentSystems,andNet-CentricComputing[3].Eachofthesecoreareasisfurthersub-dividedintotopicsandunits.TheSTEELMANdraftofCC2001presentssamplecurricularcomponentsthatdemonstratepossiblestrategiesforintegratingtopicandunitcoverageintoanundergraduateCSEeducationalexperience.Ourworkcouplestopicallywiththepro-posedintermediatecourseCS240-IntelligentSystems.TheRoboCupsimulationleague,withtheaidoftheBiterframework,couldeasilyserveasaproject-basedcomponentforthisIntelligentSystemscourse.Bitercontinuestoevolve.Newfeaturesandbehaviorsarebeingaddedandweexpectthepacetoquickenasmoreusersstarttoemployitforpedagogicalandre-searchpurposes.Wearecurrentlyworkingonthead-ditionofaGUIforthevisualdevelopmentofagentsusingJavaBeans,aswellasmorelow-levelbehaviors.Weenvisionasystemwhichwillallowuserstodrawgraphswiththebasicbehaviorsastheverticesand\in-hibits"linksasthedirectededges.Theseedgescouldbeannotatedwithsomecode.OursystemwouldthengeneratetheJavacodethatimplementstheagent.Thatis,thebehaviorswehavedenedcanbeseenascompo-nents[13]whichtheprogrammercanwiretogethertoformaggregatebehaviors.Thissystemwillallowinex-perienceduserstoexperimentwithmultiagentsystems' 2Sincethetimesliceis100ms,sendingresponsessoonerthanthatdoesnotachieveanything.