| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using Itinero.Network; |
| | | 4 | | using Itinero.Network.Enumerators.Edges; |
| | | 5 | | using Itinero.Routing.Costs; |
| | | 6 | | |
| | | 7 | | namespace Itinero.Routing.Flavours.Dijkstra.Bidirectional; |
| | | 8 | | |
| | | 9 | | internal static class ICostFunctionExtensions |
| | | 10 | | { |
| | | 11 | | public static (double cost, double turnCost) GetCost(this ICostFunction costFunction, |
| | | 12 | | RoutingNetworkEdgeEnumerator edgeEnumerator, bool tailToHead, IEnumerable<(EdgeId edgeId, byte? turn)>? previous |
| | 64 | 13 | | { |
| | 64 | 14 | | var (_, _, cost, turnCost) = costFunction.Get(edgeEnumerator, tailToHead, previousEdges); |
| | | 15 | | |
| | 64 | 16 | | return (cost, turnCost); |
| | 64 | 17 | | } |
| | | 18 | | |
| | | 19 | | public static (double cost, double turnCost) MoveToAndGetCost(this ICostFunction costFunction, |
| | | 20 | | RoutingNetworkEdgeEnumerator edgeEnumerator, EdgeId edgeId, bool forward, bool tailToHead, IEnumerable<(EdgeId e |
| | 0 | 21 | | { |
| | | 22 | | |
| | 0 | 23 | | var (_, _, cost, turnCost) = costFunction.Get(edgeEnumerator, tailToHead, previousEdges); |
| | | 24 | | |
| | 0 | 25 | | return (cost, turnCost); |
| | 0 | 26 | | } |
| | | 27 | | } |