Skip to content

Conversation

@MartinPontius
Copy link
Member

@MartinPontius MartinPontius commented Feb 5, 2026

Related Issue / Discussion:

Fixes Issues 52North/WRT-Issues#16, 52North/WRT-Issues#20

Changes:

  • New classes SpeedCrossover, RandomPercentageChangeSpeedMutation and GaussianSpeedMutation
  • Modified classes Config, CrossoverFactory, MutationFactory and FromGeojsonPopulation

Further Details:

Summary:

Crossover:
The new class SpeedCrossover allows 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:

  1. 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 %).
  2. 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 Config class are updated accordingly to allow configuring the new mutation and crossover operators.

The FromGeojsonPopulation class 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.

@MartinPontius MartinPontius added the enhancement New feature or request label Feb 5, 2026
@MartinPontius MartinPontius marked this pull request as ready for review February 6, 2026 13:02
@kdemmich kdemmich merged commit dfc2cad into main Feb 9, 2026
1 check failed
@MartinPontius MartinPontius deleted the genetic-speed-optimization branch February 9, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants