考虑速度的具体路径算法

发布于 2024-08-20 17:59:11 字数 750 浏览 2 评论 0原文

我需要创建一个算法,其中“车辆”覆盖 1262 m x 1262 m 区域,每个“腿”之间有 20% 重叠。每条腿的宽度为103 m,根据我的计算,覆盖该区域需要16“腿”。在每个航段结束时,车辆都会180度转弯,并完成下一个搜索航段。车辆以23米/秒的恒定速度行驶

现在我问这个问题的原因是一些问题:

  1. 最好的处理方法是什么 车辆的“位置” 与速度的关系?一定要拿1 第二个“快照”,只需移动 车23米? (这看起来很亲切 边缘粗糙)..

  2. 我如何处理转弯处 每条腿的末端相对于 速度?

  3. 我应该预先分配搜索吗 腿参数(即找到边界 初始化时每条腿) 或动态计算这些 每个搜索段的末尾?

  4. 我最终会 实现该算法 Java...什么java 函数/库会帮助我 时间、数学等?

  5. 我还需要考虑什么?

编辑

(回答其中一个答案)

基本上,在整个搜索区域中都会随机放置需要找到的“对象”...一旦我拿到车辆,我就会解决这个问题沿着正确的路径前进并覆盖该区域。车辆转弯时确实覆盖了区域。最小转弯半径是 12 米。我只是想让它在每个搜索航段结束时转弯,然后排队进入下一个航段

I need to create an algorithm where a "vehicle" covers a 1262 m x 1262 m area with 20% overlap between each "leg". The width of each leg is 103 m, which by my calculations gives 16 "legs" needed to cover this area. At the end of each leg, the vehicle does a 180 degree turn, and completes the next search leg. The vehicle is traveling at a constant speed of 23 meters/second

Now the reason I am asking this on SO are some issues:

  1. What is the best way to handle
    the "position" of vehicle in
    relation to the speed? Do take 1
    second "snapshots" and just move the
    vehicle 23 meters? (This seems kind
    of rough around the edges)..

  2. How do I handle the turns at the
    end of each leg with relation to the
    speed?

  3. Should I preallocate the search
    leg parameters (IE find the bounds
    on each leg at initialization time)
    or dynamically calculate these at
    the end of each search leg?

  4. I will be eventually
    implementing this algorithm in
    Java... What java
    functions/libraries will help me
    with the timing, math, etc?

  5. What else do I need to consider?

EDIT

(Answering one of the responses)

Basically, there will be randomly placed "objects" throughout the search area that this needs to find... I was going to tackle that problem, once I got the vehicle going along the correct path and covering the area. The vehicle does cover area when it turns.. The minimum turn radius is 12 Meters.. I was just going to have it turn at the end of each search leg, and line up for the next leg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

画离情绘悲伤 2024-08-27 17:59:11

您可能会研究用于寻找失踪人员、飞机、沉船等的空中或潜水搜索的搜索算法。

另一个想法是研究“空间填充曲线”的使用。 Bartholdi 的一些作品可以在此处找到。

You might look into search algortihms designed for looking for aerial or diving searches for lost people, planes, shipwrecks, etc.

Another idea is to look into the use of "space-filling curves". Some of Bartholdi's work can be found here.

╭⌒浅淡时光〆 2024-08-27 17:59:11

尽管我没有完全理解您描述背后的主要思想,但我尝试给出一些答案。

  1. 拍摄尽可能小的“快照”。在计算之间停止时间,然后根据时间移动您的车辆。下面的示例代码。

  2. 您的车辆每秒转动多少度?

  3. 如果这些没有改变,我会在开始时计算它们。

  4. 纯 Java SE 应该足以满足您的需求。检查 java.lang.Math 和 java.lang.System 的 API。


while(true) {
     final long time = System.currentTimeMillis();
     doSomeCalculations();
     doSomethingMore();
     long passedTime = System.currentTimeMillis() - time;
     vehicle.move(26.0 / 1000.0 * passedTime);
}

Even though, I do not completly get the main idea behind your describe, I try to give some answers.

  1. Take "snapshots" as small as possible. Stop time between calculations, and then move your vehicle according to the time. Example code below.

  2. How many degrees does your vehicle turn per second?

  3. If those dont change, I would calculate those in the beginning.

  4. Pure Java SE should be enough for your needs. Check the API for java.lang.Math and java.lang.System.


while(true) {
     final long time = System.currentTimeMillis();
     doSomeCalculations();
     doSomethingMore();
     long passedTime = System.currentTimeMillis() - time;
     vehicle.move(26.0 / 1000.0 * passedTime);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文