English 中文(简体)
Specific Path Algorithm with Speed Considered
原标题:

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

最佳回答

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.

问题回答

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);
}




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签