< Summary

Class:Itinero.Routing.Alternatives.AlternativeRouteSettings
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Routing/Alternatives/AlternativeRouteSettings.cs
Covered lines:4
Uncovered lines:0
Coverable lines:4
Total lines:40
Line coverage:100% (4 of 4)
Covered branches:0
Total branches:0
Tag:284_38118444584

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_MaxNumberOfAlternativeRoutes()100%1100%
get_MaxOverlap()100%1100%
get_MaxCostFactor()100%1100%
get_LocalDetourFactor()100%1100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Routing/Alternatives/AlternativeRouteSettings.cs

#LineLine coverage
 1namespace Itinero.Routing.Alternatives;
 2
 3/// <summary>
 4/// The alternative route settings.
 5/// </summary>
 6public 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>
 3016    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>
 2425    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>
 2530    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>
 2539    public double LocalDetourFactor { get; set; } = 2.0;
 40}