Genetic speed optimization #137
Merged
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.
Related Issue / Discussion:
Fixes Issues 52North/WRT-Issues#16, 52North/WRT-Issues#20
Changes:
SpeedCrossover,RandomPercentageChangeSpeedMutationandGaussianSpeedMutationConfig,CrossoverFactory,MutationFactoryandFromGeojsonPopulationFurther Details:
Summary:
Crossover:
The new class
SpeedCrossoverallows to swap speed values for pairs of points between two parents. The candidate pairs are identified by checking if their distance is below a given threshold. This approach ensures that speed values are not swapped for unrelated points.Mutation:
There are two new mutation classes which mutate ship speed:
RandomPercentageChangeSpeedMutation: Speed values are mutated by randomly adding or subtracting a percentage. The percentage is randomly chosen between 0 and a fixed maximum percentage (currently 20 %).GaussianSpeedMutation: Speed values are updated by drawing random samples from a Gaussian distribution. The mean value of the distribution is currently set to half of the maximum boat speed. The standard deviation is set to 1/6 of the maximum boat speed.The factory classes and the
Configclass are updated accordingly to allow configuring the new mutation and crossover operators.The
FromGeojsonPopulationclass was updated so that it is possible to provide a number of routes (GeoJSON files) smaller than the specified population size. In these cases, the remaining chromosomes are filled with a copy of the first route. This change is especially important for a pure speed optimization with fixed waypoints.Dependencies:
No additional dependencies
PR Checklist:
In the context of this PR, I:
Please consider that PRs which do not meet the requirements specified in the checklist will not be evaluated. Also, PRs with no activities will be closed after a reasonable amount of time.