/
Teaching Multiagent Systems using RoboCup and Biter Jo Teaching Multiagent Systems using RoboCup and Biter Jo

Teaching Multiagent Systems using RoboCup and Biter Jo - PDF document

faustina-dinatale
faustina-dinatale . @faustina-dinatale
Follow
392 views
Uploaded On 2015-05-06

Teaching Multiagent Systems using RoboCup and Biter Jo - PPT Presentation

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

Vidal Computer Science and

Share:

Link:

Embed:

Download Presentation from below link

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.


Presentation Transcript

(a)Anygoodplayerwillneedtoparsethesensorinputandcreateitsownworldmapwhichusesabsolutecoordinates.Thatis,theinputtheagentsreceivehastheobjects'coordinatesasrelativepolarcoor-dinatesfromtheplayer'scurrentposition.Whilerealistic,thesearehardtouseinthede nitionofbehaviors.Therefore,asophisticatedplayerwillneedtoturnthemintogloballyabsolutecoordi-nates.(b)Theplayersneedtoimplementseveralsophisti-catedgeometricfunctionsthatanswersomebasicquestionslike:\WhoshouldIbeabletoseenow?"(c)Theplayersalsoneedtoimplementfunctionsthatdeterminetheargumentvaluesfortheircommands.Forexample:\HowhardshouldIkickthisballsothatitwillbeatcoordinatesx;ynexttime?"2.Itishardtokeepsynchronizedwiththesoccerserver'supdateloop.Speci cally,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.Staticobjectshavea eldplacementthatdoesnotchangeduringthecourseofagame.Theseinclude ags,lines,andthegoals.Incontrast,dynamicobjectsmoveaboutthe eldduringthegame.Theseincludetheplayersandtheball.Aplayerreceivessensoryin-put,relativetohiscurrentposition,consistingofvectorsthatpointtothestaticanddynamicobjectsinhis eldofview.Sincestaticobjectshave xedlocations,theyareimportantincalculatingaplayer'sabsoluteposi-tiononthe eldofplay.Ifaplayerknowshisabsolutelocation,therelativepositionsofthedynamicobjectsinthesensoryinputcanbetransformedintoabsolutelocations.AssensoryinformationaboutdynamicobjectsisplacedintoBiter'sworldmodelitistimestampedandtheworldmodelisupdated.We rstcalculatetheplayer'sabsolutepositionusingsomeofthecloseststaticob-jectsasguide.Wethenusetheplayer'spositiontocalculatetheabsolutepositionofalldynamicobjects.Allinformationisdiscardedafteritsageexceedstheuser-de nedlimit.Userscanexperimentwiththislimit.Asmallvalueleadstoapurelyreactiveagent,alargevalueleadstotheagentseeing\ghosts"ofplayersthatarenotthereanymore.Accesstoworldmodeldatashouldbesimple;however,approachingthisextractionproblemtoosimplisticallyleadstoundesirableclutteringofcode.Thiscodeobfus-cationoccurswithaccessstrategiesthatlitterloopandtestlogicwithineveryroutinethataccessestheworldmodel.Biterutilizesadecoratorpattern[5]whichisusedtoaugmentthecapabilitiesofJava'sArrayListit-erator.Theunderlyingtechniqueusedisthatofa l-teringiterator.This lteringiteratortraversesanotheriterator,onlyreturningobjectsthatsatisfyagivencri-teria.Biterutilizesregularexpressionsfortheselectioncriteria.Forexample,dependingonproximity,thesoc-cerball'sidentityissometimesreportedas\ball"andothertimesas\Ball".Ifourprocessingalgorithmcallsfortheretrievalofthesoccerballfromtheworldmodel,wewouldinitializethe lteringiteratorwiththecrite-ria[bB]alltoreliablylocatetheobject.Sincethe l-teringcriterionisregularexpressionbased,weareabletoconstructpowerfulextractionroutineswithoutin-curringthecomplexityofcodingerror-pronecompoundconditionals.Althoughaccesstotheworldmodelhasbeenstream-lined,creatingmoreconciseandalgorithm-revealingcode,itremainsdiculttofullyunderstandthebe-havioroftheplayers.Attimesitseemstheonlywaytounderstandmomentsofunexplainablebehavioristohaveaccesstotheplayer'sworldmodel.Dumpingthecontentsoftheworldmodeltoa leforlaterinterpreta-tionisunnecessarilycomplexandunwieldy.Toattackthisproblem,Biterprovidesarun-timevisualdisplayofaplayer'sinternalviewofhisenvironment.When aBiteragentisstarted,acommand-lineparameterisusedtoenablethegraphicaldisplayoftheworldmodel.Thedisplayisservedbyanindependentthreadanduti-lizesdoublebu eringforsmoothanimation.Theover-headviewofthe eldshowsallstaticobjectsandthedynamicobjectscurrentlyfoundintheplayer'sworldmodel.Wheneverstaleelementsareencountered,analgorithmisrunwhichmergesitsdisplaycolorwiththebackgroundcolorofthe eld.Visually,thishastheef-fectofhavingstaleelementsfadeawayastheyage.Thegraphicaldisplayofaplayer'sworldmodelcanbecom-paredtothesoccermonitor'sdisplayforpurposesofindependentveri cationandvalidationoftheplayer'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,weenvisionanagentthatreceivesreadingsfromitssensorsandtakesactionsusingitse ectors.Thisisacommonmethodformodelingautonomousagents[15,Chapter1]andcapturesmanyagentapplications.TheGAAprovidesamechanismforschedulingactivi-tieseachtimetheagentreceivessomeformofinput.Anactivityisde nedasasetofactionstobeperformedovertime.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-tationsaclasshierarchyshouldbecreatedunderthisclassinordertodi erentiatebetweenthevarioustypesofsensorinputs.Biterde nesObjectInfoandObject-InfoContainerasextensionsofthisclass.TheMessageclassrepresentsamessagefromanotheragent.Robocupplayerscanuseaabroadcastmechanism(\say")tosendmessagestoallnearbyplayers.Finally,theEventclassisaspecialformofinputthatrepresentsaneventtheagentitselfcreated.Eventsfunctionasalarmssettogoo atacertaintime.Theyareimportantbecausetheyprovideawaytoimplementtimeouts.Timeoutsareusedwhenwaitingforareplytoamessage,whenwaitingforsomeinputtoarrive,orwhenrepeatedlytakinganactioninthehopeofgeneratingsomee ect.BiterimplementsaspecialinstanceofEventwhichwecalltheactevent.Thisevent reswhenthetimewin-dowforsendinganactiontothesoccerserveropens.Thatis,ittriesto reevery100ms,inaccordancewiththesoccerserver'smainloop.Sincethemessagesbe-tweenBiterandthesoccerservercanbedelayed,andtheirclockscangetskewedovertime,theactual ringtimeoftheacteventneedstobeconstantlymonitored.Biterusesanalgorithmsimilartotheoneusedin[12]forkeepingtheseeventssynchronizedwiththesoccerserver.TheActivityclassrepresentsourbasicbuildingblock.Biteragentsarede nedbycreatinganumberofactiv-itiesandlettingtheactivitymanagerschedulethemasneeded.TheActivityclasshasthreemainmemberfunctions:canHandle,handle,andinhibits.ThecanHandlememberfunctionreceivesaninputob-jectasanargumentandreturnstrueiftheactivitycanhandletheinput,thatis,ifitcanexecuteasaconse-quenceofreceivingthatinput.Thisfunctioncouldnotonlyconsiderthecontentsoftheinput,butitcouldalsoconsidertheagent'scurrentinternalstate,theagent'sworldmodel,etc.Sincethisisagenericframework,wedonotconstrainthecanHandlefunctiontoonlyaccessacertainsubsetoftheavailabledata.Thatdecisionislefttothesoftwareengineerwhowantstore nethearchitecture.Theonlyrequirementwemakeisforthefunctiontobespeedysinceitwillneedtobecalledafter anyotheractivity),toastaticorganization(activitiesinhibita xedtypeofactivities),toadynamicorgani-zation(activitiesinhibitbasedonmanyotherfactors).Asanagentmatures,theusercanchoosetoincreasetheorganizationalcomplexitywithoutre-implementingthearchitecture.AllagentimplementationsthatextendBitermustfol-lowaseriesofsteps.Firsttheagentmustinstantiateanactivitymanagerobject.Theagentthenaddsthedesiredactivitiestothisobject.Thesearetheactivi-tiesthatde neitsoverallbehavior.Itthencallstherunmethodontheactivitymanagerinordertostartitrunning.Atthispointthemanagertakescompletecon-trolandenteritsin niteloop,choosingwhichbehaviortoexecuteeverytime.Ingeneral,theusershouldnotneedtomodifythemanager.Allthecontrolknowl-edgeisstoredinthecanHandleandinhibitsmethodswhicharede nedbytheuser.6ExperienceswithBiterTheUniversityofSouthCarolinahastaughtagraduate-levelcourseinmultiagentsystemsforseveralyears.TheRoboCupsoccersimulationproblemdomainwas rstadoptedforinstructional,project-basedusefortheSpring2000semester.Studentsaredividedintogroupsoftwoorthree,andeachgroupdesignsandimple-mentsaRoboCupteam.Allgroupsmustwriteare-portontheirworkandduringthe nalweekofclassesparticipateinaclasstournament.Wemadeitclearthatagroup'sperformancedoesnotdirectlya ecttheirgrade.However,wecuriouslynotethatthegroupsof-tenseemedmoremotivatedbytheirdesiretowinthetournamentthantoachieveabettergradeintheclass.IntheSpring2000semesterwegavestudentsaveryba-sicJavaclientwhoseonlyfunctionalitywastheabilitytoparseandexchangemessageswiththesoccerserver.WealsomadeavailabletothemthesourcecodefortheCMUnitedteam[12],authoredatCarnegieMellonandwrittenin'C'.TheCMUnitedteamhadwonthepre-vioustwointernationalRoboCupcompetitions.DuetothecomplexityoftheCMUcode,thestudentsunani-mouslychosetousethesimpleJavaclientastheirbasicframeworkandtoperusetheCMUnitedcodeforideas.The nalresultsforthe rstsemesterwereencouraging.Allgroupswereabletobuildworkingteamsandpartici-pateinthe naltournament.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.Thelastproblemsetbeforethe nalcompeti-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 exibilitycontributedtothequalityofthe nalteams.IntheFallof2001classweagainusedthesameBitercode,thistimewithafewnewlow-levelbehaviorsandbug- xes.Onceagainwenoticedimprovementsintheteamperformance,albeitnotasdrasticastheprevi-ousyear.Alltheteamsexhibitedtrueteambehavior.Theyengagedinalotofpassingand,onoccasion,hadpasssequencesthatinvolvedthreeplayers|from rst,tosecond,tothird,tothegoal.Overallthestudents'experiencescontinuedtobepositive.Therewerestill,however,someareasleftforimprove-ment.Theteamsshowedapoorabilitytoresolvedead-locks.Forexample,sometimesseveralplayersfromthesameteamwouldalltrytotakecontroloftheballatthesametime,annullingeachother'sactionsinthepro-cess.Ingeneral,thestrategieswerebrittleinthattheywouldstopworkingevenaftersmallchangesweremadetothesoccerserverparameters.Finally,thereal-timeperformanceoftheteamswasstillnotuptoparwiththatofcompetitionteams|theyweremissingactionandcoordinationopportunities.7ConclusionsOurexperiencesusingRoboCupandBiterhaveproventousthatthesearee ectivetoolsforteachingstudentshowtobuildmultiagentsystems|encouragingthemtodevelopadistributedmindset.Thestudentsoftencom-mentedhowthebuildingofteamswasmuchharderthantheyinitiallyanticipated|rearmingourbeliefthattheyhadnotconsideredthecomplexitiesinvolvedinbuildingamultiagentsysteminanoisyenvironment.Their nalsuccesses,ontheotherhand,con rmedtousthattheyhadlearnedhowtosuccessfullytacklemanyoftheproblems.Ouranalysisoftheircodealsocon rmedthatBiterhadencouragedmostgroupstousepropersoftwareengineeringtechniques.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,asde nedinCC2001: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,thebehaviorswehavede nedcanbeseenascompo-nents[13]whichtheprogrammercanwiretogethertoformaggregatebehaviors.Thissystemwillallowinex-perienceduserstoexperimentwithmultiagentsystems' 2Sincethetimesliceis100ms,sendingresponsessoonerthanthatdoesnotachieveanything.