sdssd

来源:互联网 发布:淘宝卖家无需物流禁忌 编辑:程序博客网 时间:2024/06/07 14:06

1:qrand ,qnear ,qnew ←∅;
2:for i=1 to k
3:按一定的概率设置qrandqgoal或在map中随机生成qrand;
4:qnear←findQNear(qrand ,vertices);//在qrand 附近找到距离其最近的qnear.
5:qnew←findQNew(qnear ,qrand ,deltaq);//生成沿 qnearqrand 方向上,距qnear 为deltaq的qnew
6:对qnewqnear做碰撞检测;
7:if 没有碰撞
8: Vertices←Vertices∪{qnew};
9: Edges←Edges∪{qnew,qnear};
10:if qnew=qgoal or qnewnearqgoal 包围
11:path←fillSolutionPath(edges,vertices);//将Edges连接起来,即为生成的路径。
12:endif
13:endif
14:endfor
15:pathSmooth←smooth(map,path,vertices,delta);//使用贪心算法提取缩短后的路径。
16:Return T;

qrand , qnear , qnew ←∅; for(i=0 to 途经点数目){     qstart=qi;     qend=RRT(qstart,qend,vertices,delta);}RRT(qstart,qend,vertices,delta){ qrand ,qnear ,qnew ←∅;  for i=1 to k    //按一定的概率设置qrand←qgoal或在map中随机生成qrand;    qnear←findQNear(qrand ,vertices);//在qrand 附近找到距离其最近的qnear.    qnew←findQNew(qnear ,qrand ,deltaq);//生成沿 qnear和qrand 方向上,距                                                                            //qnear 为deltaq的qnew;     if qnew qnear没有碰撞        Vertices←Vertices∪{qnew};        Edges←Edges∪{qnew,qnear};        if qnew=qgoal or qnew 和near 将qgoal 包围           path←fillSolutionPath(edges,vertices);//将Edges连接起来,即为生成的路径。        endif     endif  endfor  pathSmooth←smooth(map,path,vertices,delta);//使用贪心算法提取缩短后的路径。  Return T; }