| | | 1 | | using Itinero.Profiles; |
| | | 2 | | using Itinero.Routing.Costs; |
| | | 3 | | |
| | | 4 | | namespace Itinero.Network.Search.Islands; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Picks the cost function the classifier should use for a given |
| | | 8 | | /// <see cref="IslandKind"/>. <see cref="IslandKind.Full"/> uses the profile's |
| | | 9 | | /// own cost function unchanged; <see cref="IslandKind.NonLocal"/> wraps it |
| | | 10 | | /// in <see cref="NonLocalCostFunction"/> so L-edges are masked off. |
| | | 11 | | /// </summary> |
| | | 12 | | internal static class IslandKindCostFunctions |
| | | 13 | | { |
| | | 14 | | public static ICostFunction GetFor(RoutingNetwork network, Profile profile, IslandKind kind) |
| | 2148 | 15 | | { |
| | 2148 | 16 | | var inner = network.GetCostFunctionFor(profile); |
| | 2148 | 17 | | return kind switch |
| | 2148 | 18 | | { |
| | 1046 | 19 | | IslandKind.NonLocal => new NonLocalCostFunction(inner), |
| | 1102 | 20 | | _ => inner, |
| | 2148 | 21 | | }; |
| | 2148 | 22 | | } |
| | | 23 | | } |