基于案例推理的路径规划分析-path planning analysis based on case-based reasoning.docxVIP

  • 11
  • 0
  • 约2.69万字
  • 约 39页
  • 2018-05-18 发布于上海
  • 举报

基于案例推理的路径规划分析-path planning analysis based on case-based reasoning.docx

基于案例推理的路径规划分析-path planning analysis based on case-based reasoning

摘要摘要路径搜索是计算机游戏中最为常见的任务之一,搜索算法的质量很大程度上影响着游戏的趣味性与可玩性。A*算法是最典型的启发式搜索算法,在路径确实存在的情况下,它能够确保得到一条最优路径。然而,该算法有着较高的时间和空间复杂度,因此,它不适用于多任务快速路径规划的问题。为了使A*算法满足多任务快速路径规划的需求,本文提出了基于案例推理的路径规划算法。采用离线和在线过程相结合,提出了案例(即已知路径的起始终止点对)的kd 树存储和查询机制,并给出了案例的重用方法。首先,在离线状态下,随机产生和保存一些路径作为已知案例,并根据这些案例构建kd 树。其次,在线状态下,当新任务出现的时候,我们不再简单的利用A*算法从头进行搜索,而是在kd树中快速查询最相似的案例。然后我们给出了案例的重用机制:判断所查询到的这个案例是否满足预先设定的阈值。如果满足阈值条件,那么我们就利用这条所选出来的预存相似案例,然后对该路径进行适当的调整来得到新任务的解决方案。否则,我们就要利用A*对这个新任务进行路径规划。最终,该算法通过牺牲部分内存空间来存储案例,缩短了路径规划的时间。试验结果表明,在特定的存储条件下,随着存储案例的增多,新任务能够取得更高效的路径规划。关键词K维空间树最近邻算法基于案例的推理曼哈顿距离ⅠAbstractAbstractPathfindingisoneofthemostcommontasksincomputergames,anditsqualityhasagreatinfluenceupontheinterestofGame.A*isofthemosttypicalheuristicsearchalgorithm, whichcanfindanoptimalpathifsuchapathreallyexists.However,A*suffersfromhightimeandspacecomplexity,therefore,itisnotsuitableforthemulti-taskfastpathfinding.In ordertomakeA*tomeettheneedsofmulti-taskfastpathfinding,weintroducedcase-basedreasoningmethodintheprocessofA*algorithminthispaper.Combiningtheprocessof onlineandoffline,weputforwardakindofkdtree’storingandqueryingmechanismofthecase(s)andprovidethecase(s)reusingmethod.Firstly,wegeneratesomepathsandstorethemascasesandbuildakd-treeaccordingtothecasesinthecasebaseoffline.Secondly,whenanewtaskiscomingonline,itnolongerusesA*tofindapathfromscratch,butfirstlyquerythemostsimilarcaseinthekd-tree.Then,weprovidethereusingmechanismofthecase(s):judgetheselectedcasewhethermeetthethresholdconditionwesetinadvanceornot.Iftheselectedcasemeets the thresholdconditionwesetbefore,thenwewillreusetheselectedpathwhichispre-storedinthecasebase.Asolutiontothenewtaskwillbeobtainedafteradaptingthefoundsimilarcase(s).Otherwise,thepathfindingwillbedonebyA*independently.Finally,thealgorithmcanreducethesearchtimeatthecostofusingmorememorytostorefoundpaths.Theexperimentalresultsshowthat,undercertainstorageconditions,withtheincreasingnumberofthestoredpaths,thenewcomingtaskwillhaveanefficientimplementation.KeywordsKd-treeNearest-neighborssearcha

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档