| | | 1 | | namespace Itinero.Routing.Alternatives; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// The alternative route settings. |
| | | 5 | | /// </summary> |
| | | 6 | | public class AlternativeRouteSettings |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// The maximum number of routes returned, the fastest route included. 1 asks for no |
| | | 10 | | /// alternatives. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <remarks> |
| | | 13 | | /// Fewer may come back: on a short trip where every path uses the same approach roads, the |
| | | 14 | | /// overlap limit correctly admits none. |
| | | 15 | | /// </remarks> |
| | 30 | 16 | | public int MaxNumberOfAlternativeRoutes { get; set; } = 3; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// How much of its own length an alternative may share with the routes already returned, 0 to 1. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <remarks> |
| | | 22 | | /// Measured against the union of the fastest route and every alternative already accepted, so |
| | | 23 | | /// a second alternative differs from the first one too. |
| | | 24 | | /// </remarks> |
| | 24 | 25 | | public double MaxOverlap { get; set; } = 0.2; |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// The budget as a multiple of the fastest route's cost. Nothing costing more is considered. |
| | | 29 | | /// </summary> |
| | 25 | 30 | | public double MaxCostFactor { get; set; } = 1.5; |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// How much more a stretch that leaves the fastest route may cost than the stretch it replaces. |
| | | 34 | | /// </summary> |
| | | 35 | | /// <remarks> |
| | | 36 | | /// This is what rejects a detour that saves nothing: leaving a motorway for a roundabout and |
| | | 37 | | /// rejoining it stays within budget overall but costs several times the stretch it skips. |
| | | 38 | | /// </remarks> |
| | 25 | 39 | | public double LocalDetourFactor { get; set; } = 2.0; |
| | | 40 | | } |