人工智能游戏开发

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

ConnectFourusingAlpha-BetaPruningBillyLandowskiCptS5407December2010OverviewBackgroundConnectFourasasearchproblemAlpha-betapruningDetailsaboutwinningHeuristicsImplementation/DemoConclusionBackgroundSoldbyMiltonBradleyinFebruary19742playersAlternateturnsGoal:Connectfourtilesinarowhorizontally,vertically,ordiagonallyConnectFourasaSearchProblem≤7possiblemovesperturnEnumerateeachmoveContinueforeachboardconfigurationPlayer1Player2ConnectFourasaSearchProblemStates:Anyboardconfigurationwithatmostoneplayer’stileineachlocationInitialState:Anemptygameboardwithnotiles.Actions:Placeatileofthecurrentplayer’scolorintoanycolumnthatisnotfull.TransitionModel:Returnsaboardconfigurationwithatileaddedtothespecifiedcolumn.Goal/TerminalTest:Aplayerhasfourofhertilesinalineeitherhorizontally,vertically,ordiagonally,orthegameboardisfull(indicatingatie).Utility:+∞ifplayerhasconnectedfour,0ifboardisfull,–∞ifopponenthasconnectedfour.Alpha-betapruningO(bd/2)timecomplexityb=branchingfactor=7d=depth=7×6=42ComputationallyintensiveNeedcut-offdepthCanalsoaddheuristicsWinningConnectFourTowin,playerneedsa“winningline”of43-out-of-4HeuristicTowin,playerneedsa“near”winninglineof33-out-of-4Heuristic(cont.)Counttotal3-out-of-4“unblocked”winninglinesComparetoopponentUtility(p,G)=f(p,G)–f(opponent(p),G)f(a,G)=#of3-out-of-4winninglinesforplayeraonboardGScoreboardHeuristicExtend3-out-of-4heuristicton-out-of-4forn≤3AwardweightedpointsbasedonthevalueofnScore(p,G)=100(n3)+10(n2)+1(n1)niisthenumberofi-out-of-4winninglinesforplayerpongameboardGScoreboardHeuristic(cont.)Five1-out-of-4winninglines(n1=5)Five2-out-of-4winninglines(n2=5)Score=100(0)+10(5)+1(5)=55ScoreboardHeuristic(cont.)Compareplayers’scoresUtility(p,G)=Score(p,G)–Score(opponent(p),G)ImplementationWritteninC#under.NETFrameworkMicrosoftVisualStudio2008WindowsFormsapplicationCPUDifficulties4difficulties–Beginner–random–Moderate–alpha-betapruningwithcutoff-depth3andsimpleutilityfunction–Hard–alpha-betapruningwithcutoff-depth6and3-out-of-4heuristic–Expert–alpha-betapruningwithcutoff-depth6andscoreboardheuristicAspectofrandomnessComparisonofCPUDifficultiesDemonstration

1 / 16
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功