Performance PipeInFruitMap #1120
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will replace the setPipeInFruitMap calculation in AIDriveStrategyCombineCourse with a segmented approach.
Background is a field course with > 500.000 waypoints. It takes > 4min on my PC to execute setPipeInFruitMap function before a harvester is starting to work and game is frozen during this time. Approach is to divide the calculation in small pieces to calculate the PipeInFruitMap. Currently 80 calculations are done in each update-frame, leading to complete the PipeInFruitMap after ~2min (Surprise!!!). During this time the isPipeInFruitAtWaypointNow function is used to determine if pipe might be in fruit area if isPipeInFruitAt value is not yet available. If isPipeInFruitAt value is available it will be used.
Possible further improvements:
Remark:
I will not invest more time on this, so leave it up to you: Take it, improve it or drop it.