文档库 最新最全的文档下载
当前位置:文档库 › A星寻路入门双语版(A-star Pathfinding for Beginners)

A星寻路入门双语版(A-star Pathfinding for Beginners)

A星寻路入门双语版(A-star Pathfinding for Beginners)
A星寻路入门双语版(A-star Pathfinding for Beginners)

A* Pathfinding for Beginners

This article has been translated into Spanish and French. Other translations are welcome.

While it is easy once you get the hang of it, the A* (pronounced A-star) algorithm can be complicated for beginners. There are plenty of articles on the web that explain A*, but most are written for people who understand the basics already. This one is for the true beginner. 虽然掌握了A*(读作A-star)算法就认为它很容易,对于初学者来说,它却是复杂的。网上有很多解释A*的文章,不过大多数是写给理解了基础知识的人。本文是给初学者的。

This article does not try to be the definitive work on the subject. Instead it describes the fundamentals and prepares you to go out and read all of those other materials and understand what they are talking about. Links to some of the best are provided at the end of this article, under Further Reading.

本文并不想成为关于这个主题的权威论文。实际上它讨论了基础知识并为你做一些准备,以便进一步阅读其他资料和理解它们讨论的内容。本文的后面列出了几个最好的文章,在进阶阅读中。

Finally, this article is not program-specific. You should be able to adapt what's here to any computer language. As you might expect, however, I have included a link to a sample program at the end of this article. The package contains two versions: one in C++ and one in Blitz Basic. It also contains executables if you just want to see A* in action.

最后,本文不是编程规范的。你应该能够改写这里的东西到任何计算机语言上。如你所期望的,同时,我包含了一个示例程序的链接,在本文后面结束的地方。这个程序包有两个版本:一个是C++,另一个用Blitz Basic语言编写。如果你只是想看看A*的行为,里面也含有可执行exe文件。

But we are getting ahead of ourselves. Let's start at the beginning ...

但我们要超越自己。让我们从头开始 ...

介绍:搜索区域Introduction: The Search Area

Let's assume we have someone who wants to get from point A to point B and that a wall separates the two points. This is illustrated in the graphic found below, with green being the starting point A, red being the ending point B, and the blue filled squares being the wall in between.

我们假设某人想从A点到达B点,一堵墙把它们分开了。如下图所示,绿色是开始点A,红色是结束点B,而蓝色填充的方块是中间的墙。

[图1][Figure 1]

The first thing you should notice is that we have divided our search area into a square grid. Simplifying the search area, as we have done here, is the first step in pathfinding. This particular method reduces our search area to a simple two dimensional array. Each item in the array represents one of the squares on the grid, and its status is recorded as walkable or unwalkable. The path is found by figuring out which squares we should take to get from A to B. Once the path is found, our person moves from the center of one square to the center of the next until the target is reached.

你应该注意的第一件事是,我们把搜索区域分割成了方块的格子。简化搜索区域,如你目前完成的那样,这是寻路的第一步。这个特殊方法把搜索区域简化成了一个二维数组。数组的每一个项目代表了格子里的一个方块,它的状态记录成可行走和不可行走。通过计算出从A到达B应该走哪些方块,就找到了路径。一旦路径找到,我们的人从一个方块的中心移动到下一个方块的中心,直到抵达目标。

These center points are called "nodes". When you read about pathfinding elsewhere, you will often see people discussing nodes. Why not just refer to them as squares? Because it is possible to divide up your pathfinding area into something other than squares. They could be rectangular, hexagons, or any shape, really. And the nodes could be placed anywhere within the shapes ?????? in the center or along the edges, or anywhere else. We are using this system, however, because it is the simplest.

这些中心点称作“节点”。当你在其它地方阅读关于寻路时,你将经常发现人们讨论节点。为什么不直接把它们认为是方块呢?因为有可能你要把你的寻路区域以非方块的东西来分割。它们可能是矩形,六角形,或任何形状,真的。而节点可以放到形状内的任何位置。在中心,或者沿着边缘,或其它地方。然而我们使用这个系统,因为它最简单。

开始搜索Starting the Search

Once we have simplified our search area into a manageable number of nodes, as we have done with the grid layout above, the next step is to conduct a search to find the shortest path. In A* pathfinding, we do this by starting at point A, checking the adjacent squares, and generally searching outward until we find our target.

一旦我们把搜索区域简化成了可以管理的大量节点,就象我们上面所做的那样采用格子的布局,下一步就是引导一个搜索来找出最短路径。在A*寻路的做法,我们从开始点A做起,检查它周围的方块,并且向外普通的搜索,直到找到目标。

We begin the search by doing the following:

我们这样开始搜索:

1.Begin at the starting point A and add it to an "open list" of squares to be considered.

The open list is kind of like a shopping list. Right now there is just one item on the list, but we will have more later. It contains squares that might fall along the path you

want to take, but maybe not. Basically, this is a list of squares that need to be

checked out.

2.从开始点A起,添加它到待考虑的方块的“开放列表”。开放列表有点象购物列表。此时只有一个

项目在里面,但很快我们会得到更多。它包含了你可能取用的沿途的方块,也可能不用它。基本上,这是需要检查的方块的列表。

3.Look at all the reachable or walkable squares adjacent to the starting point, ignoring

squares with walls, water, or other illegal terrain. Add them to the open list, too. For each of these squares, save point A as its "parent square". This parent square stuff is important when we want to trace our path. It will be explained more later.

4.观察开始点邻近的所有可到达或可行走的方块,忽略有墙,水或其他非法地形的方块。也把它们

添加到开放列表。对每一个方块,保存A 点作为它们的“父亲”。这个父亲方块在跟踪路径时非常重要。后面会更多的解释。

5.Drop the starting square A from your open list, and add it to a "closed list" of squares

that you don't need to look at again for now.

6.把开始方块A从开放列表中取出,并放到“封闭列表”内,它是所有现在不需要再关注的方块的列

表。

At this point, you should have something like the following illustration. In this diagram, the dark green square in the center is your starting square. It is outlined in light blue to indicate that the square has been added to the closed list. All of the adjacent squares are now on the open list of squares to be checked, and they are outlined in light green. Each has a gray pointer that points back to its parent, which is the starting square.

在此,你应该有了类似下图的东西。在这个图中,中间的深绿色的方块就是开始方块。它有浅蓝色的外框,表示它被添加到封闭列表了。所有的相邻方块现在都进入要检查的方块的开放列表中了,它们有浅绿的外框。每一个都有灰色的指针指回它的父亲,它就是开始方块。

[图2][Figure 2]

Next, we choose one of the adjacent squares on the open list and more or less repeat the earlier process, as described below. But which square do we choose? The one with the lowest F cost.

下一步,我们从开放列表中,选出一个相邻的方块,然后多多少少重复早先的过程,下面会说到。但是我们选择哪一个呢?具有最小F值的那个。

路径排序Path Scoring

The key to determining which squares to use when figuring out the path is the following equation:

找到形成路径的方块的关键是下面的等式:

F =

G + H

where

这里

?G = the movement cost to move from the starting point A to a given square on the grid, following the path generated to get there.

?G = 从开始点A到格子中给定方块的移动代价,沿着到达该方块而生成的那个路径。

?H = the estimated movement cost to move from that given square on the grid to the final destination, point B. This is often referred to as the heuristic, which can be a bit confusing. The reason why it is called that is because it is a guess. We really don't

know the actual distance until we find the path, because all kinds of stuff can be in the way (walls, water, etc.). You are given one way to calculate H in this tutorial, but

there are many others that you can find in other articles on the web.

?H = 从格子中给定的方块到最终目标B点的评估移动代价。这种方式通常称作试探法,有点让人混乱。因为这是一个猜测,所以得到这个称谓。在找到路径之前,我们真的不知道实际的距离,因为途中有各种东西(墙,水,等等)。在本教程里给出了一种计算H的方法,但在网上你能找到很多其他的文章。

Our path is generated by repeatedly going through our open list and choosing the square with the lowest F score. This process will be described in more detail a bit further in the article. First let's look more closely at how we calculate the equation.

我们需要的路径是这样生成的:反复的遍历开放列表,选择具有最小F值的方块。这个过程在本文稍后会详细描述。先让我们看看如何计算前面提到的等式。

As described above, G is the movement cost to move from the starting point to the given square using the path generated to get there. In this example, we will assign a cost of 10 to each horizontal or vertical square moved, and a cost of 14 for a diagonal move. We use these numbers because the actual distance to move diagonally is the square root of 2 (don't be scared), or roughly 1.414 times the cost of moving horizontally or vertically. We use 10 and 14 for simplicity's sake. The ratio is about right, and we avoid having to calculate square roots and we avoid decimals. This isn't just because we are dumb and don't like math. Using whole

numbers like these is a lot faster for the computer, too. As you will soon find out, pathfinding can be very slow if you don't use short cuts like these.

如上所述,G是经由到达它的路径,从开始点到给定方块的移动代价。在本例中,我们为每个水平/垂直的移动指定代价为10,而斜角的移动代价为14。我们使用这些值,因为斜角移动的实际距离是2的平方根(别害怕),或者大概1.414倍的水平/垂直的移动代价。出于简化的目的使用了10和14。比例大致是正确的,而我们却避免了方根和小数的计算。倒不是我们没有能力做或者不喜欢数学。使用这些数字也能让计算更快一些。以后你就会发现,如果不使用这些技巧,寻路的计算非常慢。

Since we are calculating the G cost along a specific path to a given square, the way to figure out the G cost of that square is to take the G cost of its parent, and then add 10 or 14 depending on whether it is diagonal or orthogonal (non-diagonal) from that parent square. The need for this method will become apparent a little further on in this example, as we get more than one square away from the starting square.

既然我们沿着到达给定方块的路径来计算G的值,找出那个方块的G值的方法就是找到其父亲的G值,再加上10或者14而得,这依赖于他处于其父亲的斜角或者直角(非斜角)而定。这在本例后面会更加清晰,随着我们从开始点离开而得到更多的方块。

H can be estimated in a variety of ways. The method we use here is called the Manhattan method, where you calculate the total number of squares moved horizontally and vertically to reach the target square from the current square, ignoring diagonal movement. We then multiply the total by 10. This is called the Manhattan method because it's like calculating the number of city blocks from one place to another, where you can't cut across the block diagonally. Importantly, when calculating H, we ignore any intervening obstacles. This is an estimate of the remaining distance, not the actual distance, which is why it's called the heuristic. Want to know more? You can find equations and additional notes on heuristics here. H能通过多种方法估算。我们这里用到的方法叫做Manhattan方法,计算从当前方块经过水平/垂直移动而到达目标方块的方块总数。然后将总数乘以10。这种方法之所以叫做Manhattan方法,因为他很象计算从一个地点到达另一个地点的城市街区数量计算,此时你不能斜向的穿越街区。重要的是,当计算H的时候,要忽略任何路径中的障碍。这是一个对剩余距离的估算值,而不是实际值,这就是试探法的称谓由来。想知道更多?关于试探法的更多说明在这里。

F is calculated by adding

G and H. The results of the first step in our search can be seen in the illustration below. The F, G, and

H scores are written in each square. As is indicated in the square to the immediate right of the starting square, F is printed in the top left, G is printed in the bottom left, and H is printed in the bottom right.

G和H相加就算出了F。第一步搜索的结果见下图的描述。F,G,和H值都写入了每个方块。如开始方块相邻右边的方块,F显示在左上方,G显示在左下方,而H显示在右下方。

[图3][Figure 3]

So let's look at some of these squares. In the square with the letters in it, G = 10. This is because it is just one square from the starting square in a horizontal direction. The squares immediately above, below, and to the left of the starting square all have the same G score of 10. The diagonal squares have G scores of 14.

好,让我们来观察某些方块。在有字母的方块中,G = 10。这是由于在水平方向上从开始点(到那里)只有一个方块(的距离)。开始点相邻上方,下方和左边的方块都具有同样的G值:10。斜角的方块G值为14。

The H scores are calculated by estimating the Manhattan distance to the red target square, moving only horizontally and vertically and ignoring the wall that is in the way. Using this method, the square to the immediate right of the start is 3 squares from the red square, for a H score of 30. The square just above this square is 4 squares away (remember, only move horizontally and vertically) for an H score of 40. You can probably see how the H scores are calculated for the other squares.

H的计算通过估算Manhattan距离而得,即:水平/垂直移动,忽略途中的障碍,到达红色的目标方块的距离。用这种方法,开始点相邻右边的方块和红色方块相距3个方块,那么H值就是30。其上的方块距离为4(记住,只能水平或者垂直移动),H就是40。你也许可以看看其他方块的H值是如何算出的。

The F score for each square, again, is simply calculated by adding G and H together.

每个方块的F值,再说一下,不过就是G和H相加。

持续的搜索Continuing the Search

To continue the search, we simply choose the lowest F score square from all those that are on the open list. We then do the following with the selected square:

为了继续搜索,我们简单的选择开放列表里具有最小F值的方块。然后对选定的方块做如下操作:

4.Drop it from the open list and add it to the closed list.

5.将他从开放列表取出,并加入封闭列表。

6.Check all of the adjacent squares. Ignoring those that are on the closed list or

unwalkable (terrain with walls, water, or other illegal terrain), add squares to the

open list if they are not on the open list already. Make the selected square the

"parent" of the new squares.

7.测试所有的相邻方块。忽略封闭列表内的和不可行走的(墙,水及其它非法地形)方块,如果方

块不在开放列表中,则添加进去。将选定方块作为这些新加入方块的父亲。

8.If an adjacent square is already on the open list, check to see if this path to that

square is a better one. In other words, check to see if the G score for that square is lower if we use the current square to get there. If not, don't do anything.

On the other hand, if the G cost of the new path is lower, change the parent of the adjacent square to the selected square (in the diagram above, change the direction of the pointer to point at the selected square). Finally, recalculate both the F and G

scores of that square. If this seems confusing, you will see it illustrated below.

9.如果一个相邻方块已经存在于开放列表,检查到达那个方块的路径是否更优。换句话说,检查经

由当前方块到达那里是否具有更小的G 值。如果没有,不做任何事。

相反,如果新路径的G值更小,把这个相邻方块的父亲改为当前选定的方块(在上图中,修改其指针方向指向选定方块)。最后,重新计算那个方块的F和G值。如果这样还是很迷惑的话,后面还会有图解说明。

Okay, so let's see how this works. Of our initial 9 squares, we have 8 left on the open list after the starting square was switched to the closed list. Of these, the one with the lowest F cost is the one to the immediate right of the starting square, with an F score of 40. So we select this square as our next square. It is highlight in blue in the following illustration.

好了,让我们看看它是怎样工作的。在初始的9个方块中,当开始方块被纳入封闭列表后,我们的开放列表就只有8个方块了。在这些块中,具有最小F值的是开始方块相邻右边的那个,其F值为40。所以我们选定这个块作为下一个方块。在随后的图例中,它以高亮的蓝色表示。

[图4][Figure 4]

First, we drop it from our open list and add it to our closed list (that's why it's now highlighted in blue). Then we check the adjacent squares. Well, the ones to the immediate right of this square are wall squares, so we ignore those. The one to the immediate left is the starting

square. That's on the closed list, so we ignore that, too.

首先,我们把它从开放列表取出,并加入到封闭列表(这就是它现在是高亮的蓝色的原因)。然后我们检查相邻的方块。然而,这个方块相邻右边的是代表墙的方块,所以忽略它们。其相邻左边是开始方块。它处于封闭列表内,所以也忽略它

The other four squares are already on the open list, so we need to check if the paths to those squares are any better using this square to get there, using G scores as our point of reference. Let's look at the square right above our selected square. Its current G score is 14. If we instead went through the current square to get there, the G score would be equal to 20 (10, which is the G score to get to the current square, plus 10 more to go vertically to the one just above it). A G score of 20 is higher than 14, so this is not a better path. That should make sense if you look at the diagram. It's more direct to get to that square from the starting square by simply moving one square diagonally to get there, rather than moving horizontally one square, and then vertically one square.

其它4个已经在开放列表中了,所以我们需要检查经由当前方块到达他们是否是更优的路径,使用G值为参考点。我们来看看这个选定方块上面右边的那个方块。它的当前G值是14。如果我们经由当前方块到达那里,G值将是20(10,到达当前方块的G值,再加上10垂直移动到它上面的方块)。20 > 14,所以这不是一个好的路径。看看图解能更好的理解这些。从开始方块斜向移动到那个方块更直接,而不是水平移动一个方块,再垂直移动一个方块。

When we repeat this process for all 4 of the adjacent squares already on the open list, we find that none of the paths are improved by going through the current square, so we don't change anything. So now that we looked at all of the adjacent squares, we are done with this square, and ready to move to the next square.

当我们对已经存在于开放列表的所有4个相邻方块都重复这个过程,我们发现经由当前方块没有更佳的路径,所以什么也不用改变。现在看看所有的相邻方块,我们已经处理完毕,并准备移动到下一个方块。

So we go through the list of squares on our open list, which is now down to 7 squares, and we pick the one with the lowest F cost. Interestingly, in this case, there are two squares with a score of 54. So which do we choose? It doesn't really matter. For the purposes of speed, it can be faster to choose the last one you added to the open list. This biases the search in favor of squares that get found later on in the search, when you have gotten closer to the target. But it doesn't really matter. (Differing treatment of ties is why two versions of A* may find different paths of equal length.)

现在,我们再遍历开放列表,它只有7个方块了,选择具有最小F值的那个。有趣的是,此时有两个方块都有值54。那么我们选择哪个?实际上这不算什么。为了速度的目的,选择你最后加入到开放列表的那个方块更快。当你更接近目标的时候,它倾向于后发现的方块。但这真的没什么关系。(不同的处理造成了两个版本的A*可能找到不同的等长路径。)

So let's choose the one just below, and to the right of the starting square, as is shown in the following illustration.

我们选择下面的那个,位于开始方块的右边,如下图所示。

[图5][Figure 5]

This time, when we check the adjacent squares we find that the one to the immediate right is a wall square, so we ignore that. The same goes for the one just above that. We also ignore the square just below the wall. Why? Because you can't get to that square directly from the current square without cutting across the corner of the nearby wall. You really need to go down first and then move over to that square, moving around the corner in the process. (Note: This rule on cutting corners is optional. Its use depends on how your nodes are placed.)

这一次,当检查相邻的方块时,我们相邻右边的是一个墙方块,所以忽略它。对那个方块上面的块同样忽略。我们也忽略墙下面的方块。为什么?因为你不把临近墙的角切开就无法直接到达那个方块。实际上你需要先向下走,然后越过那个方块,在这个过程中都是围绕角在移动。(说明:切开角的规则是可选的。它的使用依赖于你的节点如何放置。)

That leaves five other squares. The other two squares below the current square aren't already on the open list, so we add them and the current square becomes their parent. Of the other three squares, two are already on the closed list (the starting square, and the one just above the current square, both highlighted in blue in the diagram), so we ignore them. And the last square, to the immediate left of the current square, is checked to see if the G score is any lower if you go through the current square to get there. No dice. So we're done and ready to check the next square on our open list.

这样就剩下5个方块了。当前方块下的两个方块不在开放列表中,所以要添加他们,并把当前方块作为它们的父亲。在另外三个方块中,有两个已经在封闭列表中了(开始方块,和当前方块上面的那个,它们都用高亮的蓝色在图中标出来了),所以忽略它们。最后一个方块,当前方块相邻左边的那个,检查经由当前方块到达那里是否得到更小的G值。没有。所以处理完毕,并准备检查开放列表中的下一个方块。

We repeat this process until we add the target square to the open list, at which point it looks something like the illustration below.

我们重复这个过程,直到把目标点添加到开放列表,此时的情形如下图所示。

[图6][Figure 6]

Note that the parent square for the square two squares below the starting square has changed from the previous illustration. Before it had a G score of 28 and pointed back to the square above it and to the right. Now it has a score of 20 and points to the square just above it. This happened somewhere along the way on our search, where the G score was checked and it turned out to be lower using a new path ??? so the parent was switched and the G and F scores were recalculated. While this change doesn't seem too important in this example, there are plenty of possible situations where this constant checking will make all the difference in determining the best path to your target.

注意开始方块向下的第二个方块,在前面的描述中其父亲已经发生改变。开始它的G值为28,指向其右上角的方块。现在它的值是20,指向其上方的方块。这是在搜索方法中某处发生的吗?在那里G值被检查,而且使用新的路径后,它得到了更小的值。所以它的父亲切换了,G和F也重新计算。而这个改变在本例中不见得非常重要,还有足够多的可能位置,在决定最佳路径的时候,持续的检查会产生各种差别。

So how do we determine the actual path itself? Simple, just start at the red target square, and work backwards moving from one square to its parent, following the arrows. This will eventually take you back to the starting square, and that's your path! It should look like the following illustration. Moving from the starting square A to the destination square B is simply a matter of moving from the center of each square (the node) to the center of the next square on the path, until you reach the target. Simple!

那么我们怎样决定实际的路径呢?简单,从红色目标方块开始,向后移动到它的父亲,跟从箭头的指示。最终你会回到开始方块,这就是路径!它应该如下图所示。从方块A移动到目标方块B就是从每一个方块(节点)的中心移动到路径上的下一个方块的中心的简单过程,直到到达目标。简单!

[图7][Figure 7]

A*方法汇总Summary of the A* Method

Okay, now that you have gone through the explanation, let's lay out the step-by-step method all in one place:

好了,现在你已经读完了解释,让我们在这里一步一步的列出所有操作:

1.Add the starting square to the open list.

2.添加开始方块到开放列表。

3.Repeat the following:

4.重复下面的过程:

a) Look for the lowest F cost square on the open list. We refer to this as the current

square.

a) 查找开放列表中具有最小F值的方块。我们把它作为当前方块。

b) Switch it to the closed list.

b) 把它放入封闭列表。

c) For each of the 8 squares adjacent to this current square ???????

c) 对当前方块的8个相邻方块的每一个?

o If it is not walkable or if it is on the closed list, ignore it. Otherwise do the following.

o如果它不可行走,或者存在于封闭列表,忽略它。否则执行下面操作。

o If it isn't on the open list, add it to the open list. Make the current square the parent of this square. Record the F, G, and H costs of the square.

o如果它不在开放列表,将它添加进去。以当前方块作为其父亲。记录这个方块的F,G 和H值。

o If it is on the open list already, check to see if this path to that square is better, using G cost as the measure. A lower G cost means that this is a better path.

If so, change the parent of the square to the current square, and recalculate

the G and F scores of the square. If you are keeping your open list sorted by

F score, you may need to resort the list to account for the change.

o如果它已经在开放列表了,检查到达那个方块的路径是否更优,以G值为测量值。更低的G值意味着更好的路径。如果找到,这个方块的父亲改为当前方块,并重新计算这个

方块的G和F值。如果你保持开放列表按F值排序的话,可能需要重新排序来解决这个

变化。

d) Stop when you

d) 结束循环,当你

o Add the target square to the open list, in which case the path has been found, or

o将目标方块加入到开放列表,此时路径已经找到,或者

o Fail to find the target square, and the open list is empty. In this case, there is no path.

o没有找到目标方块,并且开放列表是空的。此时,没有路径。

5.Save the path. Working backwards from the target square, go from each square to its

parent square until you reach the starting square. That is your path.

6.保存路径。从目标方块往回走,从每个方块走到它的父亲方块,直到抵达开始方块。那就是路径。

一点感慨Small Rant

Forgive me for digressing, but it is worth pointing out that when you read various discussions of A* pathfinding on the web and in assorted forums, you will occasionally see someone refer to certain code as A* when it isn't. For the A* method to be used, you need to include the elements just discussed above -- specifically open and closed lists and path scoring using F, G, and H. There are lots of other pathfinding algorithms, but those other methods are not A*, which is generally considered to be the best of the lot. Bryan Stout discusses many of them in the article referenced at the end of this article, including some of their pros and cons. Sometimes alternatives are better under certain circumstances, but you should understand what you are getting into. Okay, enough ranting. Back to the article.

原谅我离题了,但是值得指出的是,当你在网上和分类论坛阅读很多讨论A*寻路的时候,你有时候会发现某些人所指的A*代码实际上并不是真正的A*算法。对于应用中的A*方法,你需要包含上面讨论到的元素-- 特别是开放列表和封闭列表,以及使用F,G,和H的路径排序。有很多其他的寻路算法,但是其它的方法不是A* -- 通常认为它是最好的算法。Bryan Stout在本文后面的一个参考文档里讨论了这些算法,有正面的,也有反面的。有时候在特定的环境下,选择其他的算法会更好,但是你应该理解你做了什么。好了,说够了。回到文章中来。

关于实现的提示Notes on Implementation

Now that you understand the basic method, here are some additional things to think about when you are writing your own program. Some of the following materials reference the

program I wrote in C++ and Blitz Basic, but the points are equally valid in other languages. 现在你已经理解了基本的方法,这里是当你写自己的程序时要考虑的更多东西。下面的某些材料引用了我用C++和Blitz Basic写的程序,但是这些要点对其他语言也是同样有效的。

1. Maintaining the Open List: This is actually one of the most time consuming elements of the A* pathfinding function. Every time you access the open list, you need to find the square that has the lowest F cost. There are several ways you could do this. You could save the path items as needed, and simply go through the whole list each time you need to find the lowest F cost square. This is simple, but really slow for long paths. This can be improved by maintaining a sorted list and simply grabbing the first item off the list every time you need the lowest F-cost square. When I wrote my own, this was the first method I used.

1.维护开放列表: 实际上这是A*寻路函数最耗费时间的元素之一。每次访问开放列表时,你都需要找到具有最小F值的方块。有很多种方法可以做到这点。你可以保存所需的路径项目,每次当你需要找到最小F值的方块时,简单的遍历整个列表。这很简单,不过路径长的时候非常慢。这个方法可以改进,通过维护一个排序的列表,每次需要最小F值的方块时,简单的抓出第一个项目就可以了。当我写自己的程序时,这是我用到的第一个方法。

This will work reasonably well for small maps, but it isn't the fastest solution. Serious A* programmers who want real speed use something called a binary heap, and this is what I use in my code. In my experience, this approach will be at least 2-3 times as fast in most situations, and geometrically faster (10+ times as fast) on longer paths. If you are motivated to find out more about binary heaps, check out my article, Using Binary Heaps in A* Pathfinding.

这个方法对小的地图相当的好,但不是最快的方案。真正需要速度的认真的A*程序员使用叫做二元堆[binary heap]的东西,这也是我的代码中所使用的。以我的经验,在大多数解决方案中,这个方法会快至少2-3倍,在长路径上更快(10倍以上)。如果你有兴趣发现更多二元堆的奥秘,参考我的文章,Using Binary Heaps in A* Pathfinding。

2. Other Units: If you happen to look closely at my example code, you will notice that it completely ignores other units on the board. My pathfinding critters actually pass right through each other. Depending on the game, this might be okay or it might not. If you want to consider other units on the board and have them move around each other, I suggest ignoring other units in the path finding code itself and instead writing some new code that detects whether two units have bumped into each other. When that happens, you can generate a new path or use some standard movement rules (always move to the right, etc.) until the obstacle is no longer in the way, and then generate a new path. Why not include other units when you are calculating the initial path? Well, because other units can move, they may not be where they were by the time you get there. This can produce some weird results, where a unit swerves to avoid a unit that isn't there anymore and bumps into units that have moved across its path after the path is calculated.

2. 其他单元:如果你碰巧深入的阅读我的范例代码,将会注意到它完全忽略了地图上的其他单元。我的寻路怪物实际上是穿越彼此而通过。依赖于游戏,这可能是正确的,或者是不正确的。如果你要考虑地图上的其他单元,并让他们能围绕彼此移动,我建议你在寻路代码里忽略其他的单元,而另外写一些代码来检测两个单元是否发生了碰撞。当碰撞发生时,你可以生成一个新路径或者使用一些标准的移动规则,直到障碍不在路上,然后生成新路径。当计算初始路径时,为什么不包含其他单元?嗯,因为其他单元会动,

他们可能不在自己的位置,当你到达那里的时候。这会造成一些怪异的结果,路径计算后,在某处单元突然转向避开一个不再停留在那里的单元,却撞上了另一个经过它路径的单元。

Ignoring other units in the pathfinding code, however, means that you will need to write separate code to handle collisions. This is fairly game specific, so I'll leave its resolution to you. Bryan Stout's article in the references section at the end of this article is worth checking out for some possible solutions (like robust tracing, etc.).

寻路代码中忽略其他的单元,然而,这意味着你要写单独的代码来处理碰撞。这是和游戏很相关的,所以我把决定权留给你。本文后面的参考资料一节里,Bryan Stout的文章值得一读,里面有一些可能的解决方案(如强力跟踪[robust tracing],等等)。

3. Some More Speed Tips: As you develop your own A* program, or adapt the one I wrote, you will eventually find that pathfinding is using a hefty chunk of your CPU time, particularly if you have a decent number of pathfinding critters on the board and a reasonably large map. If you read the stuff on the net, you will find that this is true even for the professionals who design games like Starcraft or Age of Empires. If you see things start to slow down due to pathfinding, here are some ideas that may speed things up:

3. 关于速度的更多技巧:当你开发自己的A*程序,或者改编我所写的那个,最终你会发现寻路使用了大块的CPU时间,特别是当你有大量的寻路怪物,运行在一个相当大的地图上的时候。如果你读网上的资料,你会发现甚至像星际争霸[Starcraft]或者帝国时代[Age of Empires]这样的专业游戏也会遇到这些问题。如果你发现由于寻路导致运行变慢,这里有一些可能提高速度的主意:

?Consider a smaller map or fewer critters.

?考虑小一些的地图或者少一些的怪物。

?Never do path finding for more than a few critters at a time. Instead put them in a queue and spread them out over several game cycles. If your game is running at, say,

40 cycles per second, no one will ever notice. But they will notice if the game seems

to slow down every once in a while when a bunch of critters are all calculating paths at the same time.

?不要一次对太多的怪物做寻路。而是把他们放入队列,从而把他们分散到更多的游戏循环。如果你的游戏运行在,比如,40帧/秒,没有人会注意到。但是他们会注意到每一小段时间的游戏变

慢,当大量的怪物都在同一时间寻路的时候。

?Consider using larger squares for your map. This reduces the total number of squares searched to find the path. If you are ambitious, you can devise two or more

pathfinding systems that are used in different situations, depending upon the length of the path. This is what the professionals do, using large areas for long paths, and then switching to finer searches using smaller squares/areas when you get close to the target. If you are interested in this concept, check out my article Two-Tiered A* Pathfinding.

?考虑对地图使用大一些的方块。这样就减少了寻路要搜索的方块总数。如果你有雄心的话,可以设计两种或更多寻路系统,依赖于路径的长度而用于不同的场合。这就是专业人士的做法,对长

路径使用大的区域,然后当接近目标时切换到使用小一些的方块/区域的精确搜索。如果你对这个

概念有兴趣,参考我的文章Two-Tiered A* Pathfinding。

?Consider using a waypoint system for longer paths, or devising precalculated paths that are hardwired into the game.

?考虑对较长的路径应用路点系统,或者设计预计算[precalculated]的多个路径,它们对游戏是固定不变[hardwired]的。

?Consider pre-processing your map to figure out what areas are inaccessible from the rest of the map. I call these areas "islands." In reality, they can be islands or any

other area that is otherwise walled off and inaccessible. One of the downsides of A* is that if you tell it to look for paths to such areas, it will search the whole map,

stopping only when every accessible square/node has been processed through the

open and closed lists. That can waste a lot of CPU time. It can be prevented by

predetermining which areas are inaccessible (via a flood-fill or similar routine),

recording that information in an array of some kind, and then checking it before

beginning a path search. In the Blitz version of my code, I have created a map

pre-processor that does this. It also pre-identifies dead-ends that the path finding

algorithm can ignore, which speeds things up even further.

?考虑预处理地图,计算出哪些区域是从其他区域不可到达的。我把这些区域叫做“岛屿”。实际上,他们也可以是岛屿或者其他围了墙而无法到达的区域。A*的缺点之一就是,如果你告诉它搜索到达这些区域的路径,它会搜索整个地图,仅当每一个开放列表和封闭列表中的可到达方块/节点都处理后,才会停止。那会浪费大量的CPU时间。这种现象是可以避免的,通过预先决定那些区域是无法到达的,用数组或者类似的数据结构记录这些信息,然后在开始路径搜索前检查它。在我的代码的Blitz版本中,我创建了一个地图预处理器[map pre-processor]来做这件事。它也预先检查寻路算法可以忽略的死点[dead-ends],这样速度就提高了很多。

4. Variable Terrain Cost: In this tutorial and my accompanying program, terrain is just one of two things ??????? walkable or unwalkable. But what if you have terrain that is walkable, but at a higher movement cost? Swamps, hills, stairs in a dungeon,

etc. ??????? these are all examples of terrain that is walkable, but at a higher cost than flat, open ground. Similarly, a road might have a lower movement cost than the surrounding terrain.

4. 多样的地形代价:在本教程以及我的附带程序里,地形只有两种情况:可行走和不可行走。如果你有可以行走但移动代价更高的地形怎么办?沼泽,山坡,地下城的楼梯,等等?这些都是可行走而移动代价高于平坦地面的地形实例。同样的,道路可能具有比它周围地形小一些的移动代价。

This problem is easily handled by adding the terrain cost in when you are calculating the G cost of any given square. Simply add a bonus cost to such squares. The A* pathfinding algorithm is already written to find the lowest cost path and should handle this easily. In the simple example I described, when terrain is only walkable or unwalkable, A* will look for the shortest, most direct path. But in a variable-cost terrain environment, the least cost path might involve traveling a longer distance ??????? like taking a road around a swamp rather than plowing straight through it.

这个问题很容易解决,当计算任意给定的方块的G值时,加上地形的代价。简单的加上一个奖励代价给这些方块。A*寻路算法已经写成查找最小代价的路径,应该容易处理它。在我描述得简单示例中,当地形只有可行走和不可行走时,A*能找到最短,最直接得路径。但是在多代价[variable-cost]地形环境中,最小代的得路径可能行走了较长的距离。如同选择围绕沼泽的道路,而不是直接穿越沼泽。

An interesting additional consideration is something the professionals call "influence mapping." Just as with the variable terrain costs described above, you could create an

additional point system and apply it to paths for AI purposes. Imagine that you have a map with a bunch of critters defending a pass through a mountain region. Every time the computer sends somebody on a path through that pass, it gets whacked. If you wanted, you could create an influence map that penalized squares where lots of carnage is taking place. This would teach the computer to favor safer paths, and help it avoid dumb situations where it keeps sending troops and critters through a particular path, just because it is shorter (but also more dangerous).

还有一个有趣的附加考虑是被专业人士称作“影响映射[influence mapping]”的东西。如同上面描述的多代价地形一样,你可以创建一个附加的点系统,并引用到AI的路径中。想象你有一个地图,有大量的怪物守护着穿越山区的通道。每次当电脑送某人到经过这个通道的路径时,都会被困住。如果你愿意,你可以创建一个影响地图,处罚发生大量流血残杀处的那些方块。这会教电脑偏好安全的路径,并帮助它避免不利的位置:仅仅由于路径更短(但更危险),而不停的输送部队和怪物通过这个路径。

5. Handling Unexplored Areas: Have you ever played a PC game where the computer always knows exactly what path to take, even though the map hasn't been explored yet? Depending upon the game, pathfinding that is too good can be unrealistic. Fortunately, this is a problem that is can be handled fairly easily.

5. 处理未探索区域:你是否玩过一款PC游戏,在那里电脑总是准确的知道路该如何走,即使地图没有探索?依赖与游戏,那样的寻路太好了反而不够真实。幸运的是,这个问题很容易解决。

The answer is to create a separate "knownWalkability" array for each of the various players and computer opponents (each player, not each unit -- that would require a lot more computer memory). Each array would contain information about the areas that the player has explored, with the rest of the map assumed to be walkable until proven otherwise. Using this approach, units will wander down dead ends and make similar wrong choices until they have learned their way around. Once the map is explored, however, pathfinding would work normally.

答案就是创建一个独立的“发现可行走[knowWalkability]”数组用于每一个玩家以及电脑对手(每一个玩家,不是每一个单元-- 那将需要更多的计算机内存)。每个数组包含了玩家已探索区域的信息,另一方面,地图上其它区域直到被证实后才被假设是可行走的。使用这个方法,单元会漫步于死点位置,重复做相同的错误选择,直到他们发现周围的路。一旦地图都探索了,寻路就正常工作。

6. Smoother Paths: While A* will automatically give you the shortest, lowest cost path, it won't automatically give you the smoothest looking path. Take a look at the final path calculated in our example (in Figure 7). On that path, the very first step is below, and to the right of the starting square. Wouldn't our path be smoother if the first step was instead the square directly below the starting square?

6. 更平滑的路径:虽然A*会自动给出最短的,最低代价的路径,它不会自动给出看起来最平滑的路径。看一看本例最后计算出来的路径(图7)。那条路径的第一步位于开始方块的右下方。如果第一步的方块就是开始方块相邻下方的方块,路径会不会更平滑些?

There are several ways to address this problem. While you are calculating the path you could penalize squares where there is a change of direction, adding a penalty to their G scores. Alternatively, you could run through your path after it is calculated, looking for places where choosing an adjacent square would give you a path that looks better. For more on the whole

issue, check out Toward More Realistic Pathfinding, a (free, but registration required) article at https://www.wendangku.net/doc/c63493027.html, by Marco Pinter.

有很多方法可以解决这个问题。当你计算路径的时候,要处罚那些改变方向的方块,给它们一个附加的G 值扣分。这样计算后,你可以走一遍那条路径,看一看那些选择了邻近方块而让路径看起来更好的地方。关于这个问题的完整信息,参考https://www.wendangku.net/doc/c63493027.html,上Macro Pinter的文章Toward More Realistic Pathfinding,它是免费的,但需要注册。

7. Non-square Search Areas: In our example, we used a simple 2D square layout. You don't have to use this approach. You could use irregularly shaped areas. Think of the board game Risk, and the countries in that game. You could devise a pathfinding scenario for a game like that. To do this, you would need to create a table for storing which countries are adjacent to which, and a G cost associated with moving from one country to the next. You would also need to come up with a method for estimating H. Everything else would be handled the same as in the above example. Instead of using adjacent squares, you would simply look up the adjacent countries in the table when adding new items to your open list.

7. 非方块搜索区域:在我们的示例中,我们使用了一个简单的2D方块布局。你不必使用这个方法。你可以使用不规则的形状区域。考虑一下棋盘游戏Risk,和游戏中的国家。你可以设计一个象那样的寻路关卡。为此,你将需要创建一个表来存储哪些国家和哪些国家相邻,以及相关的从一个国家移动到另一个国家的G值。你也需要选择一种估算H值的方法。其它的处理就和上面示例一样。当添加新项目到开放列表中时,你将简单的查找表中的国家,而不是邻近的方块。

Similarly, you could create a waypoint system for paths on a fixed terrain map. Waypoints are commonly traversed points on a path, perhaps on a road or key tunnel in a dungeon. As the game designer, you could pre-assign these waypoints. Two waypoints would be considered "adjacent" to one another if there were no obstacles on the direct line path between them. As in the Risk example, you would save this adjacency information in a lookup table of some kind and use it when generating your new open list items. You would then record the associated G costs (perhaps by using the direct line distance between the nodes) and H costs (perhaps using a direct line distance from the node to the goal). Everything else would proceed as usual.

同样的,你可以创建一个路点系统,对于固定地形场景中的路径。路点通常是一条路径上往来移动的点,这路径可能是一条道路,也可能是一个地下城的关键通道。作为游戏设计者,你能预先指定这些路点。如果没有障碍存在于两个路点间的直线路径上,就可以认为它们是“相邻”的,如同在Risk中那样,你应该保存这些邻接信息到一个某种类型的查找表中,当生成新的开放列表项目的时候使用它。然后记录相关的G 值(可能是节点间的直线距离)和H值(可能是节点到目标的直线距离)。其他的和往常一样处理。

For another example of searching on an isometric RPG map using a non-square search area, check out my article Two-Tiered A* Pathfinding.

另有一个使用非方块搜索区域进行斜视角RPG地图搜索的例子,参考我的文章Two-Tiered A* Pathfinding。

进阶阅读Further Reading

Okay, now you have the basics and a sense of some of the advanced concepts. At this point, I'd suggest wading into my source code. The package contains two versions, one in C++ and one in Blitz Basic. Both versions are heavily commented and should be fairly easy to follow, relatively speaking. Here is the link.

好了,现在你具备了基础知识和对一些高级概念的感觉。在这里,我建议你到我的代码中跋涉。程序包有两个版本,一个是C++的,另一个是用Blitz Basic语言写的。两个版本都有大量注释,应该容易理解。链接在这里。

?Sample Code: A* Pathfinder (2D) Version 1.71

If you do not have access to C++ or Blitz Basic, two small exe files can be found in the C++ version. The Blitz Basic version can be run by downloading the free demo version of Blitz Basic 3D (not Blitz Plus) at the Blitz Basic web site. An online demonstration by Ben O'Neill can be found here.

如果你无法使用C++或者Blitz Basic,可以找到C++版本的两个exe执行文件。通过在Blitz Basic的网站下载免费的demo版Blitz Basic 3D,就能运行Blitz Basic版本。还能找到Ben O…Neill写的在线使用示范。

You should also consider reading through the following web pages. They should be much easier to understand now that you have read this tutorial.

你也应该考虑通读下面的网页。阅读了本文后,它们应该非常容易理解了。

?Amit's A* Pages: This is a very widely referenced page by Amit Patel, but it can be a bit confusing if you haven't read this article first. Well worth checking out. See

especially Amit's own thoughts on the topic.

?Amit's A* Pages: 这是Amit Patel维护的一个很广泛的参考页面,如果你开始没有读过本文,它是有点混乱的。很值得一读。特别看一下关于Amit本人的思想那个主题。

?Smart Moves: Intelligent Path Finding: This article by Bryan Stout at https://www.wendangku.net/doc/c63493027.html, requires registration to read. The registration is free and well worth it just to reach this article, much less the other resources that are available there. The program

written in Delphi by Bryan helped me learn A*, and it is the inspiration behind my A* program. It also describes some alternatives to A*.

?Smart Moves: Intelligent Path Finding : 这篇文章位于https://www.wendangku.net/doc/c63493027.html,,Bryan Stout 所写,需要注册才能阅读。注册是免费的,为了这篇文章是值得的,因为此类的文章可不多见了。

程序是Bryan用delphi语言写的,它帮助我学会了A*,我的A*程序背后也有它的灵感。它也讨论了一些替代A*的解决方案。

?Terrain Analysis: This is an advanced, but interesting, article by Dave Pottinger, a professional at Ensemble Studios. This guy coordinated the development of Age of

Empires and Age of Kings. Don't expect to understand everything here, but it is an interesting article that might give you some ideas of your own. It includes some

discussion of mip-mapping, influence mapping, and some other advanced

AI/pathfinding concepts. The discussion of "flood filling" was an inspiration for my

own "dead ends" and "islands" map preprocessing code, which is included in the Blitz version of my program.

?Terrain Analysis: 这是一篇高阶的文章(但很有趣),Dave Pottinger所写。Ensemble Studios的专家。这些家伙开发了帝国时代[Age of Empires]和帝国时代II:帝王时代[Age of Kings]。不要指望能理解这里的所有东西,但它是一篇有趣的文章,也许能带给你一些属于你自己的想法。它包含了一些mip映射[mip- mapping],影响映射[influence mapping],和一些其他的高级AI/寻路的概念的讨论。对”洪水泛滥[flood filling]“的讨论给予了我设计自己的"死点[dead ends]"和"岛屿"地图预处理代码的灵感,这些都包含在我的程序的Blitz版本里面。

Some other sites worth checking out:

其它值得拜访的站点:

?aiGuru: Pathfinding

?Game AI Resource: Pathfinding

?https://www.wendangku.net/doc/c63493027.html,: Pathfinding

Well, that's it. If you happen to write a program that uses any of these concepts, I'd love to see it. I can be reached at

好了,没有了。如果你要应用这些概念来写一个程序的话,我很高兴看到它。我的联系地址是

Until then, good luck!

那么,祝好运!

玄空九宫飞星计算法

年飞星计算法 年飞星是每年在立春后之后,更换年岁之天干地支时一齐更换的飞星。 起例诀:上元甲子起一白,中元四绿甲子游,下元七赤兑上发,九星顺走逆年头。 古历以一百八十年为一周,每一甲子六十年为一元,共谓之三元。 前六十年谓之上元,中六十年谓之中元,后六十年谓之下元。 三元分九运,每运为一飞星,管二十年吉凶,共一百八十年。周而复始,循环不息。 以下为最近三元的年飞星 上元:60年大运:1864年甲子至1923年癸亥每20年为一小运;一白运1864年至1883年二黑运1884年至1903年三碧运1904年至1923年 中元:60年大运:1924年甲子至1983年癸亥每20年为一小运;四绿运1924年至1943年五黄运1944年至1963年六白运1964年至1983年 下元:60年大运:1984年甲子至2043年癸亥每20年为一小运;七赤运1984年至2003年(一运)。八白运2004年至2023年(二运)。九紫运2024年至2043年(三运)。 男性所属出生年之年飞星速求法: 1999年前用10减(出生之年尾数两位相加,如多过10则再相加)=所余之数即为所属之飞星。 例:男生于1949年10─(4+9)=余6即6白金为所属之飞星。 2000年后用 9-(出生年尾数两位相加,如多过10则再相加)=所余之数即为所属之飞星。 例:男生于2013年9-(1+3)=余5即5黄土为所属之飞星。 女性所属出生年之飞星速求法: 1999年前用 (出生年尾数两位相加)-4=所余之数即为所属之飞星。 例:女生于1954年5+4-4=5即5黄土为所属之飞星。 2000年后用 (出生年尾数两位相加)-3=所余之数即为所属之飞星。 例:女生于2015年1+5-3)=3即3碧木为所属之飞星。

【路亚】路亚钓鱼技巧大全

【路亚】路亚钓鱼技巧大全 一、路亚来源 路亚钓鱼取名来源为 Lure 的音译,是我国港澳台地区对拟饵的称乎,即假饵钓鱼,是模仿弱小生物引发大鱼攻击的一种方法。 讲究技巧,需要竿、饵、轮的综合操作。在整个过程中,钓者是在做全身运动,同时路亚装备简洁,干净环保,与传统钓法有着极大的差异。 路亚钓在欧洲非常盛行,自2007年我国也逐渐兴起路亚钓,被越来越多的钓鱼爱好者所喜爱。路亚,君子爱渔,取之有道(趣道)。 钓具配法1:直柄杆配纺车轮 钓具配法2:枪柄竿配水滴轮或者鼓轮 路亚饵:硬饵和软饵 二、路亚历史 传说19世纪初,美国钓鱼人豪顿氏在河边与朋友闲聊,手中把玩这一个小木片,一不小心,木片掉进河里,一条不知名的鱼立刻窜出叼走了木片。这个偶然的小事,触发了豪顿氏的灵感,此后他发明了世界上第一个路亚饵(拟饵)。芬兰人Lauri Rapala把拟饵做的更加极致,并推广到了全世界。随着人们对路亚的认识,根据肉食性鱼类的食性及捕食的方法,总结出了路亚钓法。 路亚钓法作为一种健康运动,环保、时尚,一直令路亚钓者引以为豪,也有人称作“水上高尔夫”。

三、路亚竿 1、路亚竿一般可区分为:直柄竿、枪柄竿。钓竿通常有分为两节式组合方便携带。当然也有单节式、多节式及伸缩式。 2、钓竿标示 SC—602ML Lure 1/8~3/8oz Line 5~10Ib;其中SC代表型号,数字60表示竿长5250 px,数字2表示节数,ML表示钓竿特性:中轻量。Lure 1/8~3/8oz表示为:钓竿使用路亚重量为:3.5—10.5g重量,Line 5~10Ib表示为钓竿实用的钓线为5—10磅,相当于1.5—2.5号尼龙线。 ?钓竿特性表示说明 ?UL=超轻量、极软。 ?L=轻量、软。 ?ML=中轻量、中软。 ?M=中量、中间。 ?MH=中重量、中硬。 ?H=重量、硬。 ?XH=特重量、极硬 ?有时还会加上F=快速调。 ?R=中间调。 ?S=慢速调

九宫飞星注解

https://www.wendangku.net/doc/c63493027.html,/paipan/pp_xk.asp 九宫飞星注解 古代科学家们在漫长时期的天文观测中发现,北斗七星(实际为九星,包括左辅星和右弼星)的运行规律与地球上自然现象和人事吉凶之间存在某种相应的暗合关系。在三元九运的不同时间,都有其中一颗星起着主导作用,并且,每颗星对地球发挥作用的时间正好为二十年。古代先贤们将北斗九星分别取名为贪狼、巨门、禄存、文曲、廉贞、武曲、破军、左辅、右弼星,并确定了三元九运中每一运的二十年由哪颗星主事,即以二十年作为一运,由北斗九星轮流掌管。以此为基础,通过三元九运与洛书九宫、北斗九星、以及九气间的有机结合,建立和发展了一套“时”与“空”统一的、可以推算阳宅运气和人的吉凶祸福的较为完备的玄空风水理论。 “三元九运”体系 以一百八十年作为一个正元,每一正元包括三个元,即上元、中元、下元;每元一个甲子六十年,分为三个运,每运为二十年,即上元是一运、二运、三运,中元是四运、五运、六运,下元是七运、八运、九运,从而构成了完整的三元和九运体系。古人又

把一到九运和玄空九星相配合: 上元一运甲子癸未二十年(1864年~1883年),配合一白贪狼星,叫一白运。 上元二运甲申癸卯二十年(1884年~1903年),配合二黑巨门星,叫二黑运。 上元三运甲辰癸亥二十年(1904年~1923年),配合三碧禄存星,叫三碧运。 中元一运甲子癸未二十年(1924年~1943年),配合四绿文曲星,叫四绿运。 中元二运甲申癸卯二十年(1944年~1963年),配合五黄廉贞星,叫五黄运。 中元三运甲辰癸亥二十年(1964年~1983年),配合六白武曲星,叫六白运。 下元一运甲子癸未二十年(1984年~2003年),配合七赤破军星,叫七赤运。 下元二运甲申癸卯二十年(2004年~2023年),配合八白左辅星,叫八白运。 下元三运甲辰癸亥二十年(2024年~2043年),配合九紫右弼星,叫九紫运。 九星在九宫格中有其特定编排,玄学口诀为:[戴九履一、左三右七、二四为肩、六八为足、五居中央。]即:五(中宫)→六(西

路亚钓翘嘴的方法技巧

路亚钓翘嘴的方法技巧 翘嘴鲌俗称:翘嘴巴(简称翘嘴)、大白鱼、翘壳、鲌、鲌丝、翘嘴白鱼、翘嘴鲌、翘嘴鲢、翘嘴红鲌。翘嘴鲌的背部和体侧上却为浅灰色,腹部为银白色,下颖肥厚向上突出上翘,尾巴是红色的被称为翘嘴红鲌,尾巴呈青色的称之为青梢鲌,最大的个体可重达10千克,是我国鳊鲌亚种最大的一种鱼。其肉白嫩,味 道鲜美。 翘嘴主要栖息在明亮的敞水区的中上层,喜欢在亮水区域活动,很少藏身在草丛中。它善于跳跃,游动迅速,嘴大贪吃,春未至秋初,常常在水面追捕小鱼小虾和落水昆虫,捕食的方式主要以视觉为主,是一种凶猛性鱼类。 翘嘴为广温性鱼类,生存水温0-38℃,摄食水温3-36℃,最适翘嘴红鲌水温15-32℃,最佳生长水温18-30℃;繁殖水温20-32℃。翘嘴鲌的生活习性(组 图) 一、路亚翘嘴的季节和时间 路亚钓翘嘴的时间各地各个季节都不一样,翘嘴一年四季都捕食,水面越大相对越容易出巨翘。翘嘴活动范围很大,一天中早晨和傍晚,捕食较为活跃,是出钓的好时间,白天在气温较高日照充足时,它喜欢呆在深水区。一年中六月前翘嘴常爱呆在水浅的地方或深浅交界的地方,因为这个时候很多鱼在岸边产卵,它也会在那里大快朵颐,这个季节有时白天也会有很好的收获,尤其天气闷有一点刮南风的天气很容易爆钓的。六月之后天气逐渐炎热之后白天基本上很难在岸边钓到它,这个时候在一些湖泊水库,建议最好在傍晚出钓,大约晚上五点半到十点半之间,这个时候一些水库的大坝就成了最好的钓点,由于大坝白天被阳光暴晒,傍晚时靠近大坝这边的水温会略高,小鱼就会在这里成群活动,翘嘴也会

每天成群结队准时来这些地方捕食,当然每个钓点由于它的地域和环境的不同, 时间也会略有差异。 仲春到仲秋,晚上六点凌晨两点,这段时间是钓获翘嘴黄金时间这是一天当中气温最适宜时间段,是翘嘴捕食的时间。凌晨两点半到四点这段时间也是温度变化最大的时间段不宜钓获。早晨四点半到六点还会有部分没吃饱的在水面捕食,它们一般离岸较远,相对较难钓获。 夏天钓鱼天气同样非常重要。夏季经常出现的风向多为东南风,东北风,西南风,偏东风,偏南风,在这几种风力条件下,偏风向优于正风向。而在偏风向中,尤属东北风和西南风最不适宜夏季垂钓。而西南风则有时优于东北风。夏季最适合出钓的风向当属东南风。 在江河中,冬季傍晚相对比春夏季好路,路获的翘嘴也相对比较大,原因是冬天靠岸浅水边的小鱼比较少,所以当你的亮片打下去的时候。翘嘴就容易发现,目标也容易锁定。冬季水温偏低,所以一般靠边觅食的都是耐寒性强个头比较大的翘嘴,攻击也比较凶狠。 钓翘嘴天气、风向、钓位的选择很重要。一般有风比无风好,有风相对气压偏高,最好选择微风。下雨比睛天好。有风的阴雨天,翘嘴非常活跃,摄食凶猛。风向方面,一般钓迎风或顺边风。在钓位的选择上,一般深沟比浅滩好,有草比泥底好,尖嘴比回水湾好。

A 寻路算法模拟实现 C++ 可运行

////////////////////////////////////////////////////////////////////////// // // // // //写一个自己实现的A*搜索算法 ////////////////////////////////////////////////////////////////////////// #include"stdafx.h" #include #include #include #include #include using namespace std; const int nMapWidth = 8; const int nMapHeight = 8; struct Node { int nEnable; int nNodeMark; int nValue; int x; int y; Node():nEnable(0),nNodeMark(0),nValue(0),x(0),y(0){}; }; std::map m_OpenList;

std::map m_CloseList; std::vector m_KeyList; Node m_MapNode[nMapWidth][nMapHeight]; //计算openlist中靠前节点周围的节点 void ComputerRound(int curx,int cury); //将一个新的节点加入到OPenList中 void AddNodeToOpenList(Node* pNode,int nNum); //打印地图 void Print(Node pNode[][nMapHeight]); void Print(Node pNode[][nMapHeight]) { for (int n = 0; n < nMapWidth; ++n) { for(int m = 0; m < nMapHeight; ++m) { if (m == 0) cout<nEnable)) return; if (m_OpenList.empty()) { m_OpenList[pNode->nNodeMark] = nNum; m_KeyList.push_back(pNode->nNodeMark); } else { std::map::iterator itr = m_OpenList.find(pNode->nNodeMark); if (itr == m_OpenList.end()) { std::map::iterator itrQ = m_CloseList.find(pNode->nNodeMark); if (itrQ != m_CloseList.end())

九星算法

运、年、月、日、时紫白九星(飞星计算法) 1、运星上元甲子一、二、三,中元甲子四、五、六,下元甲子七、八、九运。 2、流年九星,根据上中下三元,分别为上元甲子起一白、中元甲子起四绿、下元甲子起七赤。 3、月飞星起例诀:子午卯酉八白求,辰戌丑未五宫游,四孟之年从二黑,逆寻月份顺宫流。 说明:子午卯酉年正月起八白,辰戌丑未年正月起五黄,寅申巳亥年正月起二黑。正月入中逆推月份顺飞九宫,流年及流月都是逆推顺数。 4、日飞星计算法——日飞星诗: 日家紫白不难求,二十四气六宫周,冬至阳生前后节,顺行甲子一宫移,雨水便从七宫起,谷雨还从四绿推,阴生夏至九宫逆,处暑前后三碧是,霜降六宫起甲子,顺逆分明十二支,有是何星当值日,移入中宫顺逆飞。 说明:日飞星是由冬至前后最近的甲子日起一白顺行,如甲子日起一白,乙丑日起二黑,丙寅日起三碧等,到雨水的前后甲子则应该是七赤,到谷雨的前后甲子应该是四绿。由于夏至一阴生,所以由夏至前后最近的甲子日起九紫逆行,如甲子日起九紫,乙丑日起八白,丙寅日起七赤等,到处暑的前后甲子则应该是三碧,到霜降的前后甲子则应该是六白。 5、时飞星计算法——时飞星诗: 三元时白最为佳,冬至阳生顺莫差,孟日七宫仲一白,季日四绿发萌芽, 每把时辰起甲子,本时星耀照光华,时星移入中宫去,顺飞八方逐细查, 夏至阴生逆回首,孟归三碧季加六,仲在九宫时起甲,依然掌中逆轮跨。 说明:冬至后,子午卯酉日,时辰的子时起一白,一次顺排为丑时二、寅时三、卯时四、辰时五、巳时六、午时七、未时八、申时九、酉时一、戌时二、亥时三;辰戌丑未时的子时为四绿;寅申巳亥日的子时为七赤。 夏至后,寅申巳亥日的子时为三碧,依次逆排丑时为二、寅时为一。。。;子午卯酉日的子时为九;辰戌丑未日的子时为六。

路亚钓法

时尚路亚系统路亚选择

17 鲢鱼 鱼类特种路亚 餐条路亚 白条是路亚对象鱼的一种,但由于体积和嘴都相对较小,一直都是不很理想的对象鱼!最小的亮片也只能上到相对大一些的白条!因此,本人经过几次实践性的实验,改装了一组路亚,专门针对大小各异的白条。效果相当不错!好东西是值得与大家一起分享的! 上2图为网络截图,以方便各位看清楚饵的样子以及大小(钩长6MM)! 本人所用飞蝇饵,针对白条和马口每一只饵的效果都很好,建议各位朋友不要使用DIY或者国内饵!因为钩钝,钩大,饵的做工也相当的劣质! 准备一:飞蝇饵两颗 饵为沉水飞蝇饵。不管是沉水系还是浮水系的饵效果是一样,因为在收线过程中,饵一定会处在水表面的位置! 准备二:4X飞蝇子线 可以用台钓0.4~0.6子线代替,(网友建议也可以加大到1.0-1.2,可以减少缠绕)。为方便看清楚连接,本人这里使用了红色线连接。 准备三:5g波爬一只,之所以选波爬是因为,波爬在回收过程中产生的水流能引起白条的注意!加之波爬是完全漂浮水表上,和白条生活水层较为接近!说明一点,波爬不能做漂用! 把备用子线连接到波爬连接环上,另外一端连接飞蝇饵!

相信大家都能看得懂的吧?子线的长度可以为一尺左右,用一长一短的子线不容易使钩子打结!收饵的过程中,均匀慢收,不用抽动波爬!遇给口,也不要扬杆刺鱼!白条抢食时的咬力就足够将自身勾稳!至于为什么不要刺鱼的原因,各位自己去实践就知道! 为本人4个小时内的收获!而且在作钓时不时的来几个双飞,哈哈!路亚玩出了双飞,感觉真的很爽! 单线双钩绝对的可行,但双飞几率几乎为零!你可以一试!双线双钩的双飞效果是可以刻意制造的!(网友:我用浮水米诺+飞蝇钩一样路白条,我用的是一元一个的飞蝇哟!) 餐条,属于小型鱼类,群体觅食,且捕食凶猛,多以水面中上层的落水昆虫和水生昆虫的幼体为

路亚钓鱼装备介绍

路亚学堂 基础知识 一、什么是路亚 路亚一词来自于“lure”的译音,是引诱的意思,是一种以现代科技辅以人类智慧的一种新兴钓法,也有人称作为假饵钓,拟饵钓,由于必须比其他静态钓法,更充分将环境,气候,鱼类习性等因素加以综合考量,才能在自然环境中透过操作,使假饵能发挥引诱对象鱼觅食的作用,从某个程度上来说,也就是作到真正的以假乱真。 二、路亚竿的知识 路亚竿从直观上来看有两大类直柄式(spinning)和枪柄式(casting),飞蝇竿(fly rod)除外。但又因假饵有很多样式以及操作手法的需要还有水域、对象鱼之差异,路亚竿又分为很多细的种类,如:淡水鲈鱼竿(bass rod)、鳟鱼竿(trout rod)、飞蝇竿(fly rod)、海鲈竿(sea bass rod)、乌贼竿(egi rod)、船钓铁板竿(jigging rod)等等。 三、路亚竿的常见参数 路亚竿要轻,对竿子上的导环质量要求较高,因为在一次钓鱼过程中要不停的抛投。在一般的抛投中,中调(medium)的竿子较好使用,对于操作表层系的用先调(fast或extra fast)的竿子能够最大程度的用竿子来体现假饵的活力。 竿子的从软到硬的表示方法如下表 UL——Ultra light 超软YH——Heavy 硬 L——Light 软XH——Extra heavy 超硬 ML——Medium light 中软XXH——Extra extra heavy 超超硬 M——Medium 中等

MH——Medium heavy 中硬 纺车轮 纺车轮大概是所有渔轮里面最简单使用的渔轮,由于操作简易,使用范围广,因此也一样适用在路亚钓法中。 纺车轮的特点在于能够利用机械结构,透过简单的方式,使渔线有条理的分配在线轮上,因此对于需要时常反覆抛投收线的路亚钓法来说,纺车轮是非常适合在一般人刚跨入路亚钓法所选择的渔轮款。除了和与其他钓法上有着相同的评价标准,轻量化是纺车轮在长时间路亚钓操竿过程中一个非常重要的选购考量。一般来说,路亚钓选择的纺车轮是以4000型以内的渔轮为最佳,但仍可针对使用考量而有不同的选择。近年来有许多路亚钓法开始使用编织线作为路亚钓的主要线种的趋势,因此为了节省体育线的用量,在选配的机种上,也有在纺车渔轮机种上配备浅线轮的机种出现,除了节省空间不用为了把PE线的容量缠到饱满而浪费成本,较大的线轮内直径也可有效的增加收线效率,也是一个经济实惠的选择。

九宫飞星图如何排列

九宫飞星图如何排列? 九宫飞星图的排法: (注意: 以下是09年飞星局为例) 要查表的方法: 月飞星起例诀: 子午卯酉八白求,辰戌丑未五宫游,四孟之年从二黑,逆寻月份顺宫流。 子午卯酉年正月起八白,辰戌丑未年正月起五黄,寅申巳亥年正月起二黑。 正月入中逆推月份顺飞九宫,流年及流月都是逆推顺数。 日飞星计算法 日飞星诗: 日家紫白不难求,二十四气六宫周,冬至阳生前后节,顺行甲子一宫移, 雨水便从七宫起,谷雨还从四绿推,阴生夏至九宫逆,处暑前后三碧是, 霜降六宫起甲子,顺逆分明十二支,有是何星当值日,移入中宫顺逆飞。 日飞星是由冬至前后最近的甲子日起一白顺行,如甲子日起一白,乙丑日起二黑,丙寅日起三碧等,到雨水的前后甲子则应该是七赤,到谷雨的前后甲子应该是四绿。由于夏至一阴生,所以由夏至前后最近的甲子日起九紫逆行,如甲子日起九紫,乙丑日起八白,丙寅日起七赤等,到处暑的前后甲子则应该是三碧,到霜降的前后甲子则应该是六白。 时飞星计算法 时飞星诗: 三元时白最为佳,冬至阳生顺莫差,孟日七宫仲一白,季日四绿发萌芽, 每把时辰起甲子,本时星耀照光华,时星移入中宫去,顺飞八方逐细查,

夏至阴生逆回首,孟归三碧季加六,仲在九宫时起甲,依然掌中逆轮跨 ★★九宫飞星图,也称宅命图,由三个星盘组成:运盘、山盘和向盘。 排"山盘飞星" 以运盘坐方飞星排人中宫(左上方), 以坐方飞星三元龙阴阳定顺逆轨迹,逢阳顺飞,逢阴逆飞。 关键的问题,就是把运星、山星、向星三者组合为整体,也就是排飞星盘重要的步骤。 洛书的九个数与九星相配,代表北斗七星与左辅右弼轮流值班及气场的运动规律。 请注意此处用的是后天八卦规律。九宫按洛书排布,飞星轨迹由中宫作起点,然后按照洛书数序飞移。 阳顺飞:数字由小到大排列。阴逆飞:数字由大到小排列。 顺逆飞排列顺序,按洛书由中一乾一兑一良一离一坎一坤一震一中排列。 2007年开运风水方位(红色有利) 九紫星到正东:吉庆星,家有喜庆子女学业进步 一白星到东南:桃花星,一四同宫利文学发科名 六白星到正南:小财星,利财运适地产金属武职 八白星到西南:正财星,主财运旺盛利地产金融 四绿星到正西:文昌星,利文科学业防金属所伤 三碧星到西北:是非星,防口舌官非肠胃及脚病 七赤星到正北:偏财星,利迁移远行增人缘感情 五黄星到东北:灾害星,防疾病滞运及金属所伤

路亚钓翘嘴的方法技巧

翘嘴鲌俗称:翘嘴巴(简称翘嘴)、大白鱼、翘壳、鲌、鲌丝、翘嘴白鱼、翘嘴鲌、翘嘴鲢、翘嘴红鲌。翘嘴鲌的背部和体侧上却为浅灰色,腹部为银白色,下颖肥厚向上突出上翘,尾巴是红色的被称为翘嘴红鲌,尾巴呈青色的称之为青梢鲌,最大的个体可重达10千克,是我国鳊鲌亚种最大的一种鱼。其肉白嫩,味 道鲜美。 翘嘴主要栖息在明亮的敞水区的中上层,喜欢在亮水区域活动,很少藏身在草丛中。它善于跳跃,游动迅速,嘴大贪吃,春未至秋初,常常在水面追捕小鱼小虾和落水昆虫,捕食的方式主要以视觉为主,是一种凶猛性鱼类。 翘嘴为广温性鱼类,生存水温0-38℃,摄食水温3-36℃,最适翘嘴红鲌水温15-32℃,最佳生长水温18-30℃;繁殖水温20-32℃。翘嘴鲌的生活习性(组 图) 一、路亚翘嘴的季节和时间 路亚钓翘嘴的时间各地各个季节都不一样,翘嘴一年四季都捕食,水面越大相对越容易出巨翘。翘嘴活动范围很大,一天中早晨和傍晚,捕食较为活跃,是出钓的好时间,白天在气温较高日照充足时,它喜欢呆在深水区。一年中六月前翘嘴常爱呆在水浅的地方或深浅交界的地方,因为这个时候很多鱼在岸边产卵,它也会在那里大快朵颐,这个季节有时白天也会有很好的收获,尤其天气闷有一点刮南风的天气很容易爆钓的。六月之后天气逐渐炎热之后白天基本上很难在岸边钓到它,这个时候在一些湖泊水库,建议最好在傍晚出钓,大约晚上五点半到十点半之间,这个时候一些水库的大坝就成了最好的钓点,由于大坝白天被阳光暴晒,傍晚时靠近大坝这边的水温会略高,小鱼就会在这里成群活动,翘嘴也会每天成群结队准时来这些地方捕食,当然每个钓点由于它的地域和环境的不同, 时间也会略有差异。 仲春到仲秋,晚上六点凌晨两点,这段时间是钓获翘嘴黄金时间这是一天当中气温最适宜时间段,是翘嘴捕食的时间。凌晨两点半到四点这段时间也是温度变化最大的时间段不宜钓获。早晨四点半到六点还会有部分没吃饱的在水面捕食,它们一般离岸较远,相对较难钓获。 夏天钓鱼天气同样非常重要。夏季经常出现的风向多为东南风,东北风,西南风,偏东风,偏南风,在这几种风力条件下,偏风向优于正风向。而在偏风向中,尤属东北风和西南风最不适宜夏季垂钓。而西南风则有时优于东北风。夏季最适合出钓的风向当属东南风。 在江河中,冬季傍晚相对比春夏季好路,路获的翘嘴也相对比较大,原因是冬天靠岸浅水边的小鱼比较少,所以当你的亮片打下去的时候。翘嘴就容易发现,目标也容易锁定。冬季水温偏低,所以一般靠边觅食的都是耐寒性强个头比较大的翘嘴,攻击也比较凶狠。

九星飞伏排山法教学文案

九星飞伏排山法

九星飞伏排山法 北 学习玄空风水术,对于自学者来说最难的莫过于九宫飞伏排山法,掌握了九宫飞伏排山法就等于拿到了玄空风水术的入门锁匙,对于以后的学习就顺利多了。学习玄空风水术首先要懂得三元九运,什么叫做三元九运呢,三元即上中下三元,九运即三运之中的九星,九星 依序为一白,二黑,三碧,四绿,五黄,六白,七赤,八白,九紫。上元管一白二黑三碧三星,每星管20年,每星每20年为一运;中元管 四绿五黄六白三星,每星管20年,每星每20年为一运;下元管七赤八白九紫三星,每星管20年,每星每20年为一运。九星即九运,上中下三元即为三元,每一元60年,三元共180年。 一白(一运)坎卦 二黑(二运)坤卦上元 三碧(三运)震卦 四绿(四运)巽卦 五黄(五运)无卦中元 六白(六运)乾卦 七赤(七运)兑卦 八白(八运)艮卦下元 九紫(九运)离卦

1984年到2003年为第七运,即七赤星兑卦运;2004年到2023年为第八运,即八白星艮卦运。亦可以每20年为一运往后推, 知道了三元九运之后,接下来必须要记住罗盘上的廿四山和三元干支的阴阳, 罗盘廿四山分别为: 坎卦壬子癸,艮卦丑艮寅,震卦甲卯乙,巽卦辰巽已,离卦丙午丁,坤卦未坤申,兑卦庚酉辛,乾卦戍乾亥。 三元干支阴阳分别是: 天元子午卯酉属阴,乾巽艮坤属阳;(注:天元就是廿四山每卦三山之中间字位)。人元辛丁是属阴,寅申已亥属阳(人元即廿四每卦三山之中最后一位字);地元辰戍丑未属阴,甲庚壬丙属阳(地元即廿四山每卦中之最前一位字)。 后天八卦图,又称原始九宫方位图,图如下; 巽(4)离(9)坤(2)震(3)(5)兑(7)————后天八卦图艮(8)坎(1)乾(6) 九宫飞伏排山法,如现在是第八运,就把“八”放入到上图的中宫,即在原始九宫图的“5”位置上,依原始图中5→6→7→8→9→1 →2→3→4的顺序,那么“八”放入中宫后也依此顺序排列起来就是八→九→一→二→三→四→五→六→七。与原始图的对应关系是5八同 宫,6九同宫,七1同宫……得如下图:

九宫飞星计算法5962667

九宫飞星计算法 九星图 一白水四绿木七赤金 二黑土五黄土八白土 三碧木六白金九紫火 年飞星计算法 年飞星是每年在立春后之后,更换年岁之天干地支时一齐更换的飞星。 起例诀: 上元甲子起一白,中元四绿甲子游,下元七赤兑上发,九星顺走逆年头。 古历以一百八十年为一周,每一甲子六十年为一元,共谓之三元。前六十年谓之上元,中六十年谓之中元,后六十年谓之下元。 三元分九运,每运为一飞星,管二十年吉凶,共一百八十年。周而复始,循环不息。

三元九运 上元甲子:一运 1864(甲子) ─ 1883(癸未)二运 1884(甲申) ─ 1903(癸卯)三运 1904(甲辰) ─ 1923(癸亥) 中元甲子:四运 1924(甲子) ─ 1943(癸未)五运 1944(甲申) ─ 1963(癸卯)六运 1964(甲辰) ─ 1983(癸亥) 下元甲子:七运 1984(甲子) ─ 2003(癸未)八运 2004(甲申) ─ 2023(癸卯)九运 2024(甲辰) ─ 2043(癸亥) 以下为最近三元的年飞星 上元:60年大运:1864年甲子至1923年癸亥每20年为一小运 一白运1864年至1883年二黑运1884年至1903年三碧运1904年至1923年 中元:60年大运:1924年甲子至1983年癸亥每20年为一小运 四绿运1924年至1943年五黄运1944年至1963年六白

运1964年至1983年 下元:60年大运:1984年甲子至2043年癸亥每20年为一小运 七赤运1984年至2003年八白运2004年至2023年九紫运2024年至2043年 男性所属出生年之年飞星速求法: 1999年前用 10减(出生之年尾数两位相加,如多过10则再相加)=所余之数即为所属之飞星。 例:男生于1949年10─(4+9)=余6即6白金为所属之飞星。 2000年后用 9-(出生年尾数两位相加,如多过10则再相加)=所余之数即为所属之飞星。 例:男生于2013年9-(1+3)=余5即5黄土为所属之飞星。

基于BP神经网络的扫地机器人寻路算法

龙源期刊网 https://www.wendangku.net/doc/c63493027.html, 基于BP神经网络的扫地机器人寻路算法 作者:杨忠刘华春 来源:《电脑知识与技术》2017年第10期 摘要:传统的寻路算法通常用在已知地形结构的基础上规划路线,而扫地机器人的工作环境通常是陌生的,传统寻路算法在此失效。该文结合BP神经网络的特性,提出一种基于BP 神经网络的扫地机器人寻路算法,目标是使扫地机器人能够在任何陌生的环境中正确地完成寻路任务,通过分析扫地机器人的清扫模式,建立观察模型和运动模型,利用MatLab实现对应的BP神经网络,并对传统BP网络激励函数进行了优化,最后经过训练和仿真验证了算法的有效性和实用性。 关键词:寻路算法;扫地机器A-;BP神经网络 中图分类号:TPl8 文献标识码:A 文章编号:1009-3044(2017)10-0156-03 随着科技的不断进步,智能家居理念逐步渗透了现代生活中,智能扫地机器人日益流行起来,很多厂家都开始生产智能扫地机器人。过去机器人通常只能完成一些简单的任务,但随着人工智能、传感器技术的发展,机器人的功能得到了很大的升级和改善,加上网络推广,智能扫地机器人已经真正地进入人们的日常生活。智能扫地机器人能在无人监督的情况下通过红外线传感器、超声波传感器、陀螺仪、电子罗盘、室内GPS等传感器设备扫描并学习房间局部户型结构,规划路径完成房间的清洁任务。通常由于所处位置的局限性和现代住房结构复杂等因素,难以获得完整准确的户型结构图,而要求用户事先将户型图输入机器人也不现实,因此清扫路径的规划是整个清扫活动的难点。目前通常采取线性算法进行路径规划,通过传统程序设计模式编程实现。这种方式导致扫地机器人智能程度不高,在遇到一些特殊情况时,导致整个清扫工作中断。 1.问题分析 扫地机器人按清扫路线形式可分为规划式和随机式两类。目前,扫地机器人大部分都采取随机式扫地机,即不规划路线,扫到哪算哪,碰到障碍物自己走开。规划式清扫模式:扫地机器人感知四周的环境,然后规划行走的路径,有效地遍历各个区域,完成各个区域的打扫。规划式清扫模式的行走路径方式有螺旋式行走模式,S形行走模式,五边形行走模式。其中,以螺旋行走模式的清扫效率最高,它最大程度的避免了重复路线。但单一的规划式清洁模式,始终不能完美解决障碍物问题,螺旋行走模式以程序的形式编写进扫地机器人控制中心计算机,它只能以固定不变的路径完成清扫任务,在途中若遇到形状复杂、面积较大的障碍物,如茶

(整理)九宫飞星的计算方法.

九宫飞星的计算方法(年运九宫) 九宫飞星的计算方法 我教大家最基本的原理,我们常看见电视里很多能人,仙人都会掐指一算,但是他们手指动来动去为何意?其实就是在算九宫位,我们以食指中指无名指为宫盘。三支手指上中下掌纹正好为9条,以下面的图为例 [九宫图] [九宫位数] [九宫飞顺序] 巽离坤四九二九五七 震中兑三五七八一三 艮坎乾八一六四六二 有顺飞,逆飞,看“九宫飞顺序”顺飞就是由一飞到二,二就飞到三,以此类推。不论顺逆都要先从进入中宫开始,即:飞星先进入中宫,逼迫中宫原来之星飞出,从而带动整个星盘运行!当顺飞时:巽宫之星先入中!迫使中宫之星飞入乾宫,乾宫之星飞入兑宫,兑宫之星飞入艮宫,艮宫之星飞入离宫,离宫之星飞入坎宫,坎宫之星飞入坤宫,坤宫之星飞入震宫,震宫之星巽宫,至此,一个飞星过程结束!其飞星序数是按123456789的顺行之序飞行。而逆飞刚好相反:乾宫之星先入中,迫使中宫之星飞入巽宫,巽宫之星飞入震宫,震宫之星飞入坤宫,坤宫之星飞入坎宫,坎宫之星飞入离宫,离宫之星飞入艮宫,艮宫之星飞入兑宫,兑宫之星飞入乾宫,至此一个飞星过程结束!其飞星序数是按987654321的逆行序数飞行。 九大飞星简介(2004至2023年为下元八运,以下以八运为列) 一白贪狼星:为官财星,主得名气及官位和偏财。 二黑病符星:主一切最凶这事均临门生祸,死绝症,与五黄凶星并列为一级凶星,如坐卧在此必生灾乱。 三碧禄存星,主官非是非,小人当道,贼星入屋,破财招刑,特别是口舌是非多,坐卧于此必有官非是非或是破财。 四绿文曲星:有利文化艺术,同时易招挑花事件。 五黄廉贞星:为九昨中最大的凶星,主大病绝症,孕妇失丁死亡,肾病及下阴生疮,食物中毒,破产,好赌,神经失常,口舌出疮毒,如若坐卧于此必行衰运。 六白武曲星:此星为偏财、横财星,与一白的、八白并称为三大财星。 七赤破军星:主口舌是非,刀光剑影,开刀残症凶在唇舌,又为火旺之象。身体上影响呼吸,口舌

路亚钓组示意图

路亚钓组示意图 一般而言,路亚钓法的钓组相当简单,尤其大部分栓型路亚、匙型路亚都很单纯,几乎均是母线直接连接路亚,或多加入一条子线、路亚快拆别针而已,因此很容易很快上手。 软饵七大钓组 相较起来,软饵的钓组较为复杂,为了因应不同的环境、操饵技巧,发展出几种不同的钓组,也可算是软饵最基础的钓组。 德州钓组(TEXAS RIG) 此钓组重心稳定、平衡度佳、泳形最自然的优点,适合的场地为水面多障碍、树丛以及水中烂泥较多的地方,尤其是陌生的钓场也可作为探测地形之用。此外,该钓组重心及风阻都低,所以抛投远搜索范围广,适合采用慢速及拖动方式,逐步搜索鱼只。 卡罗莱纳钓组(CAROLINA) 此钓组以平拖方式为最佳晃饵技巧,最能发挥软饵本身游动的特色。适合的场地为小岩石区、树丛、水中烂泥较多的地方。子线大致上以30公分为基准,子线越长则泳形佳,晃饵收线次数少,但鱼讯传达较差,子线越短则反之,泳形较差,但鱼讯传递较好。

咬铅钓组(SPLIT SHOT) 该钓组适用于短距离,鱼儿活动性低的钓场,故软饵种类以泳形弧度小、变化多者较佳,并切记要搭配细线。 无铅钓组(NO SINKER) 本钓组因为无外加的铅锤,所以在软饵选用上以比重高、尾部尾巴偏大或特别会摆动尾巴为上选,因为没有多于钓组配件,所以游起来特别的逼真。 倒吊钓组(Down Shot) 该钓组是特别针对「岸钓」研发,而此种钩型最适合在较平坦无障碍物区时。使用Down Shot时,软虫穿法则如同一般软虫钩法,只是绑钩子的要求和一般绑法不同,务必要求绑好的钩子和底下的钓线成90度垂直,并注意下方的铅要以舍弃铅方式固定。 铅头钩钓组(JIG HEAD) 铅头钩容易操作,亦擅长模仿小鱼及小虾逃窜的情形,藉由重心巧妙的转移,吸引鱼儿追咬,是操作简单、中鱼率高的钓组。一般常搭配旋尾蛆使用,是十分常见的钓组。

九宫飞星流年月日时飞星口诀精编版

九宫飞星: 流年流月流日流时 飞星口诀 中华周易协会研究中心 2013年秋

九宫飞星流年、流月、流日、流时的飞星口诀 一、《流年紫白星起例》 歌诀:年上吉星论甲子,逐年星逆中宫取,上中下作三元汇,一上四中七下使。 推法:上元从坎宫起甲子, 中元从巽宫起甲子, 下元从兑宫起甲子。 六十甲子的顺序依宫逆行找出该年的紫白星,然后把该星入宫,顺行排山掌就可以找出八卦新立的紫白星。以下元甲子为例,下元从兑宫起甲子,即甲子年为7,乙丑年为6,丙寅年为5,丁卯年为4,戊辰年为3······癸未年为6,甲申年为5,乙酉年为4······八方伏吟五黄所到之处不宜动。 二、《月紫白星起例》 歌诀:子午卯酉八白起, 寅申巳亥二黑求, 辰戌丑未五黄中。 推法:凡是子午卯酉年的正月为8,二月为7,三月为6,四月为5,五月为4,六月为3,七月为2,八月为1,九月为9,十月为8,十一月为7,十二月为6。 寅申巳亥年:正月为2,二月为1,三月为9,四月为8,五月为7,六月为6,七月为5,八月为4,九月为3,十月为2,十一月为1,十二月为9。

辰戌丑未年:正月为5,二月为4,三月为3,四月为2,五月为1,六月为9,七月为8,八月为7,九月为6,十月为5,十一月为4,十二月为3。 把该月的数入中顺行排山掌即可找出该月八个方向的紫白星。三、《日家紫白星起例》 歌诀:日家紫白星不难求,二十四节六宫游,冬至雨水及谷雨,阳顺一七四中游,夏至、处暑、霜降后,逆行九三六星游。 求法如下: 冬至后的第一个甲子日为一白,乙丑日为二黑,丙寅日三碧, 依次顺布······。 雨水后的第一个甲子为七赤,乙丑日为八白,丙寅日九紫, 依次顺布······。 谷雨后的第一个甲子日为四碧,乙丑日为五黄,丙寅日六白, 依次顺布······。 夏至后第一个甲子日为九紫,乙丑日八白,丙寅日为七赤 依次逆行布······。 处暑后第一个甲子日为三碧,乙丑日为二黑,丙寅日一白 依次逆行······。 霜降后的第一个甲子日为六白,乙丑日为五黄,丙寅日为四绿 依次逆行······。 把该日的星入中在排山掌(按冬至后星顺行,夏至后星逆行,即可找出该日的八个方位紫白星)。

路亚入门教程

【路亚】路亚入门讲解 一、路亚来源 路亚钓鱼取名来源为 Lure 的音译,是我国港澳台地区对拟饵的称乎,即假饵钓鱼,是模仿弱小生物引发大鱼攻击的一种方法。 讲究技巧,需要竿、饵、轮的综合操作。在整个过程中,钓者是在做全身运动,同时路亚装备简洁,干净环保,与传统钓法有着极大的差异。 路亚钓在欧洲非常盛行,自2007年我国也逐渐兴起路亚钓,被越来越多的钓鱼爱好者所喜爱。路亚,君子爱渔,取之有道(趣道)。 钓具配法1:直柄杆配纺车轮 钓具配法2:枪柄竿配水滴轮或者鼓轮 路亚饵:硬饵和软饵 二、路亚历史 传说19世纪初,美国钓鱼人豪顿氏在河边与朋友闲聊,手中把玩这一个小木片,一不小心,木片掉进河里,一条不知名的鱼立刻窜出叼走了木片。这个偶然的小事,触发了豪顿氏的灵感,此后他发明了世界上第一个路亚饵(拟饵)。芬兰人Lauri Rapala把拟饵做的更加极致,并推广到了全世界。随着人们对路亚的认识,根据肉食性鱼类的食性及捕食的方法,总结出了路亚钓法。 路亚钓法作为一种健康运动,环保、时尚,一直令路亚钓者引以为豪,也有人称作“水上高尔夫”。

三、路亚竿 1、路亚竿一般可区分为:直柄竿、枪柄竿。钓竿通常有分为两节式组合方便携带。当然也有单节式、多节式及伸缩式。 2、钓竿标示 SC—602ML Lure 1/8~3/8oz Line 5~10Ib;其中SC代表型号,数字60表示竿长5250 px,数字2表示节数,ML表示钓竿特性:中轻量。Lure 1/8~3/8oz表示为:钓竿使用路亚重量为:3.5—10.5g重量,Line 5~10Ib表示为钓竿实用的钓线为5—10磅,相当于1.5—2.5号尼龙线。 ?钓竿特性表示说明 ?UL=超轻量、极软。 ?L=轻量、软。 ?ML=中轻量、中软。 ?M=中量、中间。 ?MH=中重量、中硬。 ?H=重量、硬。 ?XH=特重量、极硬 ?有时还会加上F=快速调。 ?R=中间调。 ?S=慢速调

2012年九宫飞星图

2012年九宫飞星图、壬辰年九宫风水(2011-06-26 14:51:44) 转载▼ 标签: 分类:星相◎命理◎风水 2012年九宫飞星 2012年九星吉凶 三煞 五黄煞 太岁 2012年壬辰年 九宫飞星图

当其衰死之时,容易惹起酒色之祸,或因酒色而家散财破。对身体容易患后天耳病,肾脏衰竭,以及膀胱、睾丸、疝气、子宫的疾病。严重的会刑妻瞎眼、夭亡飘荡。 二黑土星 此星别名巨门,又号病符星,五行属土,其色为黄、黄黑。在星盘上,居中宫、乾宫、兑宫时,为生旺。在一年四季中,三月、六月、九月、十二月生旺。其余各宫位和其余月份为衰死。生旺时可得权得财、置业兴家、旺丁旺财,多出武贵,妇人当家,多谋吝啬。 当其衰死时,容易有色祸,有火灾之厄;容易招惹官非,并因此而损失钱财;容易引起各种疾病,比如流产、腹疾恶疮、各种皮肤病,特别是下阴及两腋部位。如果居屋阴暗气闷,则容易出现女鬼或阴人作崇。久居则代代寡妇当家,病人日久不愈。 三碧绿星 此星别名禄存,五行属木,绰号蚩尤。其色青绿。在星盘上,居中宫、乾位、兑位时,为生旺。在一年四季中,春季和冬季为生旺。其余宫位和季节,则为衰死。生旺时,兴家立业、富贵功名、贡监成名,长房大旺。 当其衰死时,易得官讼,易惹贼盗,易造成残病刑妻,易患脓血之灾、足疾大祸。因其如蚩尤好斗,易形成斗牛之煞、官非不断。 四绿木星 此星别名文曲,五行属木,其色翠绿。在星盘上,居中宫、乾位、兑位时,为生旺。在一年四季中,春冬为生旺。其余宫位和季节,则为衰死。生旺时,登科甲第,君子加官,小人进产,可得贤妻、良夫,文章名世,亦宜作学术研究和文学创作。 当其衰死时,易遭疯哮血缢之厄,患淫佚流荡之失,受酒色破家之苦。于身体,易患流产及腰部以下疾病,易有意外伤亡。

九宫飞星流年、流月、流日、流时的飞星口诀

九宫飞星流年、流月、流日、流时的飞星口诀 其实真正用到的布局,计算到流月即可了,流日流日无需过分排列,因这流日流时一定借助万年历二十四节气排列才能排出结果 流年流月流日流时飞星算法》 一、《流年紫白星起例》 歌诀:年上吉星论甲子,逐年星逆中宫取,上中下作三元汇,一上四中七下使;推法:上元从坎宫起甲子 中元从巽宫起甲子 下元从兑宫起甲子 六十甲子的顺序依宫逆行找出该年的紫白星,然后把该星入中顺行排山掌就可以找出八卦方位的紫白星,以下元甲子为例:下元从兑宫起甲子,即是甲子年为7、乙丑年为6、丙寅年为5、丁卯年为4、戊辰年3……癸未年为6、甲申年为5、今年五黄居中,八方伏吟,五黄所到之处不宜动 二、《月紫白星起例》 歌诀: 子午卯酉八白起 辰戌丑未五黄中 寅申巳亥二黑求 推法: 凡是子午卯酉年的正月为8、二月为7、三月为6、四月为5、……十二月为6。寅申巳亥年的正月为2、二月为1、三月为9……十二月为9。 辰戌丑未年的正月为5、二月为4、三月为3……十二月为3, 把该月的数入中顺行排山掌即可找出该月八个方位的紫白星。 三、《日家紫白星起例》 歌诀:日家白法不难求,二十四气六宫周, 冬至,雨水及谷雨,阳顺一七四中游, 夏至、处暑、霜降后,九三六星逆行求。 求法: 冬至后的第一个甲子日为一白、乙丑日为二黑、丙寅日为三碧,依次…… 雨水后的第一个甲子日为七赤、乙丑日为八白、丙寅日为九紫,依次…… 谷雨后的第一个甲子日为四碧、乙丑日为五黄、丙寅日为六白,依次…… 夏至后的第一个甲子日为九紫、乙丑日为八白,丙寅日为七赤,依次…… 处暑后的第一个甲子日为三碧、乙丑日为二黑,丙寅日为一白,依次…… 霜降后的第一个甲子日为六白、乙丑日为五黄,丙寅日为四绿,依次…… 把该日的星入中在排山掌,按冬至后星顺行,夏至后星逆行,即可找出该日八个方位的紫白星。 四、《时家紫白星起例》》 时家紫白星的求法分冬至后顺行,夏至后逆行。 冬至后: 子午卯酉日子时一白,丑时二黑,寅时三碧,卯时四绿; 辰戌丑未日子时四绿,丑时五黄,寅时六白,卯时七赤; 寅申巳亥日子时七赤,丑时八白,寅时九紫,卯时一白。 把该星入中顺飞九宫即可找出该时八方的紫白星。

路亚钓鱼的基础知识、方法和技巧

一、认识路亚钓 路亚一词来自于「LURE」的译音,是引诱的意思,是一种以现代科技辅以人类智慧的新兴钓法,也有人称作为假饵钓、拟饵钓,由于必须比其它静态钓法,更充分将环境、气候、鱼类习性等因素加以综合考虑,才能在自然环境中透过操作,使假饵能发挥引诱对象鱼觅食的作用,从某个程度上来说,也就是作到真正的『以假乱真』。 从最广义的分类来说,除了活饵、粉饵外、只要在挂钩端搭配人造材料物(如木头、金属、塑料)的钓鱼方法,就能将之理解为路亚钓法,由于路亚钓法的对象鱼多为掠食性的鱼种,不管是如毛钩拟饵钓中,需要用吸管抽出鱼胃中食物,观察其觅食习惯,参照辅以假饵钓获的钓法;或是利用显著的特征侵占对象鱼地盘,激起对象鱼攻击习性而上钩的钓法,都属于路亚钓法的一环。因此吸引对象鱼的注意,是路亚钓法里十分重要的一环。 一般来说,路亚在水中吸引鱼的方法不外乎是透过颜色、光线、泳形、声响等几种方式来完成。为了使这些因素能在水中充分发挥作用,就必须使假饵不断的来回游动、探索,因此反复的抛饵、收饵,便成了路亚钓与其它钓鱼钓法,在活动上最为明显的区隔特征,在国外特别是欧美等国家,路亚钓就如同其它的户外活动,被赋予动态、竞技的形象,而成为一种家喻户晓的户外运动。 国内近几年来,由于消费水平提高,钓鱼人口增加的情形下,再加上环保意识的抬头,路亚钓已俨然成为一股新兴的钓游趋势,无论从硬饵、软饵的使用来看,路亚器材的操作简易性更是大幅降低了许多想进入钓鱼活动初学者的门坎,进而吸引更多人的参与,享受更多的钓鱼乐趣,并与国际潮流接轨。为推广此一极富现代性的钓法,宝熊今年将在路亚时代杂志里,开辟疯马克~跟着宝熊学路亚的单元,让喜好路亚钓的朋友对路亚钓有更深一层的认识。

相关文档