|
1 | 1 | package com.conveyal.r5.rastercost; |
2 | 2 |
|
3 | | -import com.conveyal.r5.profile.ProfileRequest; |
4 | | -import com.conveyal.r5.profile.StreetMode; |
5 | 3 | import com.conveyal.r5.streets.EdgeStore; |
6 | 4 | import com.conveyal.r5.streets.StreetLayer; |
7 | | -import com.conveyal.r5.streets.TraversalTimeCalculator; |
8 | | -import com.conveyal.r5.streets.VertexStore; |
9 | | -import gnu.trove.list.TFloatList; |
10 | | -import gnu.trove.list.TShortList; |
11 | | - |
12 | | -import java.io.File; |
13 | | -import java.util.List; |
14 | 5 |
|
15 | 6 | /** |
16 | | - * Subclasses or plugin functions will provide costs for hills, sun, noise, pollution etc. |
| 7 | + * This models a field of traversal costs, in the sense of a cost that varies over geographic space having different |
| 8 | + * effects on different edges. Subclasses serve as plugins that provide costs for hills, sun, noise, pollution etc. |
| 9 | + * |
| 10 | + * CostFields could in principle apply costs to any mode of travel, and might yield different costs for different modes, |
| 11 | + * but currently they are not mode-aware. No existing implementations apply to cars, so for now CostFields are simply |
| 12 | + * ignored for car routing. Ideally CostFields would know which modes they applied to, and the list of CostFields would |
| 13 | + * be filtered before the street search happens. The logic currently in the StreetRouter constructor could be factored |
| 14 | + * into a mode-aware factory method that would yield the correct TraversalTimeCalculator. StreetRouter is explicitly |
| 15 | + * single-use with a single StreetMode. That mode could be specified up front and the TraversalTimeCalculator |
| 16 | + * chosen accordingly (avoiding the MultistageTraversalTimeCalculator construct entirely when no CostFields apply). |
17 | 17 | * |
18 | 18 | * Interface-wise, a CostField is like a TraversalTimeCalculator with no turn costs, which transforms an existing |
19 | 19 | * traversal time rather than starting from scratch. So TraversalTimeCalculator is like a special case of CostField |
|
0 commit comments