< Summary

Class:Itinero.Network.Search.Islands.ICostFunctionExtensions
Assembly:Itinero
File(s):/home/runner/work/routing2/routing2/src/Itinero/Network/Search/Islands/ICostFunctionExtensions.cs
Covered lines:4
Uncovered lines:0
Coverable lines:4
Total lines:27
Line coverage:100% (4 of 4)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
GetIslandBuilderCost(...)100%2100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero/Network/Search/Islands/ICostFunctionExtensions.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using Itinero.Network.Enumerators.Edges;
 4using Itinero.Routing.Costs;
 5
 6namespace Itinero.Network.Search.Islands;
 7
 8internal static class ICostFunctionExtensions
 9{
 10    /// <summary>
 11    /// Gets the cost of a turn from the previous edges sequence to the given edge in the enumerator in a forward direct
 12    ///
 13    /// This does NOT include the cost of the previous edges.
 14    /// </summary>
 15    /// <param name="costFunction">The cost function.</param>
 16    /// <param name="enumerator">The edge to test.</param>
 17    /// <param name="forward">Then true, calculate the cost including turn cost from (previousEdge ->) enumerator.tail -
 18    /// <param name="previousEdges">A sequence of previously traversed edge, if any.</param>
 19    /// <returns>True if the current edge is traversable and the turn cost allows the turn.</returns>
 20    public static bool GetIslandBuilderCost(this ICostFunction costFunction,
 21        RoutingNetworkEdgeEnumerator enumerator, bool forward = true, IEnumerable<(EdgeId edgeId, byte? turn)>? previous
 15222    {
 15223        var cost = costFunction.Get(enumerator, forward, previousEdges);
 24
 15225        return cost is { canAccess: true, turnCost: < double.MaxValue };
 15226    }
 27}

Methods/Properties

GetIslandBuilderCost(...)