help me....matlab very difficult...
0 个评论
采纳的回答
4 个评论
The position moved to is controlled by the lines
I = min(max(I + randi([-1 1]), 1),N); J = min(max(J + randi([-1 1]), 1),N);
At present this is done by moving to a random adjacent location (it can also end up staying in the same place, especially if it would go outside of the map.) You can change the code to follow any pattern you want.
You will need to enhance the simulation by having the drone notice when it is getting low on fuel and having it fly back for refueling.
Then, once it refuels, if it just flies the same pattern again then it will run out of fuel even sooner (because it will be dropping less spray on the places that already have enough, so it will be flying heavier than on the original pass.)
So your code should be doing path planning.
Simple example: when the drone is getting low on fuel, then flying directly back might take it back over places that have already been sprayed enough. But if the drone moves over to the next row or column and follows that back, perhaps it will encounter fewer places that have already been done. On the other hand, if the drone runs out of spray then it should fly the most fuel-efficient route back to refill. This should be part of your calculations, not just choosing a good "starting" point but also how it is eventually going to get back.
更多回答(0 个)
另请参阅
类别
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!