diff --git a/docs/Configuration.md b/docs/Configuration.md index bfd168d5955..76eeeeeb578 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -65,29 +65,29 @@ documentation below we will refer to the following types: -| Type | Description | Examples | -|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------| -| `boolean` | This is the Boolean JSON type | `true`, `false` | -| `string` | This is the String JSON type. | `"This is a string!"` | -| `double` | A decimal floating point _number_. 64 bit. | `3.15` | -| `integer` | A decimal integer _number_. 32 bit. | `1`, `-7`, `2100` | -| `long` | A decimal integer _number_. 64 bit. | `-1234567890` | -| `enum` | A fixed set of string literals. | `"RAIL"`, `"BUS"` | -| `enum-map` | List of key/value pairs, where the key is a enum and the value can be any given type. | `{ "RAIL: 1.2, "BUS": 2.3 }` | -| `enum-set` | List of enum string values | `[ "RAIL", "TRAM" ]` | -| `locale` | _`Language[\_country[\_variant]]`_. A Locale object represents a specific geographical, political, or cultural region. For more information see the [Java Locale](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Locale.html). | `"en_US"`, `"nn_NO"` | -| `date` | Local date. The format is _YYYY-MM-DD_ (ISO-8601). | `"2020-09-21"` | -| `date-or-period` | A _local date_, or a _period_ relative to today. The local date has the format `YYYY-MM-DD` and the period has the format `PnYnMnD` or `-PnYnMnD` where `n` is a integer number. | `"P1Y"`, `"-P3M2D"`, `"P1D"` | -| `duration` | A _duration_ is a amount of time. The format is `PnDTnHnMnS` or `nDnHnMnS` where `n` is a integer number. The `D`(days), `H`(hours), `M`(minutes) and `S`(seconds) are not case sensitive. | `"3h"`, `"2m"`, `"1d5h2m3s"`, `"-P2dT-1s"` | -| `regexp` | A regular expression pattern used to match a sting. | `"$^"`, `"gtfs"`, `"\w{3})-.*\.xml"` | -| `uri` | An URI path to a resource like a file or a URL. Relative URIs are resolved relative to the OTP base path. | `"http://foo.bar/"`, `"file:///Users/jon/local/file"`, `"graph.obj"` | -| `time-zone` | Time-Zone ID | `"UTC"`, `"Europe/Paris"`, `"-05:00"` | -| `feed-scoped-id` | FeedScopedId | `"NO:1001"`, `"1:101"` | -| `cost-linear-function` | A cost-linear-function used to calculate a cost from another cost or time/duration. Given a function of time: ``` f(t) = a + b * t ``` then `a` is the constant time part, `b` is the time-coefficient, and `t` is the variable. If `a=0s` and `b=0.0`, then the cost is always `0`(zero). Examples: `0s + 2.5t`, `10m + 0t` and `1h5m59s + 9.9t` The `constant` must be 0 or a positive number or duration. The unit is seconds unless specified using the duration format. A duration is automatically converted to a cost. The `coefficient` must be in range: [0.0, 100.0] | | -| `time-penalty` | A time-penalty is used to add a penalty to the duration/arrival-time/depature-time for a path. It will be invisible to the end user, but used during the routing when comparing stop-arrival/paths. Given a function of time: ``` f(t) = a + b * t ``` then `a` is the constant time part, `b` is the time-coefficient, and `t` is the variable. If `a=0s` and `b=0.0`, then the cost is always `0`(zero). Examples: `0s + 2.5t`, `10m + 0 x` and `1h5m59s + 9.9t` The `constant` must be 0 or a positive number(seconds) or a duration. The `coefficient` must be in range: [0.0, 100.0] | | -| `map` | List of key/value pairs, where the key is a string and the value can be any given type. | `{ "one": 1.2, "two": 2.3 }` | -| `object` | Config object containing nested elements | `"walk": { "speed": 1.3, "reluctance": 5 }` | -| `array` | Config object containing an array/list of elements | `"array": [ 1, 2, 3 ]` | +| Type | Description | Examples | +|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------| +| `boolean` | This is the Boolean JSON type | `true`, `false` | +| `string` | This is the String JSON type. | `"This is a string!"` | +| `double` | A decimal floating point _number_. 64 bit. | `3.15` | +| `integer` | A decimal integer _number_. 32 bit. | `1`, `-7`, `2100` | +| `long` | A decimal integer _number_. 64 bit. | `-1234567890` | +| `enum` | A fixed set of string literals. | `"RAIL"`, `"BUS"` | +| `enum-map` | List of key/value pairs, where the key is a enum and the value can be any given type. | `{ "RAIL: 1.2, "BUS": 2.3 }` | +| `enum-set` | List of enum string values | `[ "RAIL", "TRAM" ]` | +| `locale` | _`Language[\_country[\_variant]]`_. A Locale object represents a specific geographical, political, or cultural region. For more information see the [Java Locale](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Locale.html). | `"en_US"`, `"nn_NO"` | +| `date` | Local date. The format is _YYYY-MM-DD_ (ISO-8601). | `"2020-09-21"` | +| `date-or-period` | A _local date_, or a _period_ relative to today. The local date has the format `YYYY-MM-DD` and the period has the format `PnYnMnD` or `-PnYnMnD` where `n` is a integer number. | `"P1Y"`, `"-P3M2D"`, `"P1D"` | +| `duration` | A _duration_ is a amount of time. The format is `PnDTnHnMnS` or `nDnHnMnS` where `n` is a integer number. The `D`(days), `H`(hours), `M`(minutes) and `S`(seconds) are not case sensitive. | `"3h"`, `"2m"`, `"1d5h2m3s"`, `"-P2dT-1s"` | +| `regexp` | A regular expression pattern used to match a sting. | `"$^"`, `"gtfs"`, `"\w{3})-.*\.xml"` | +| `uri` | An URI path to a resource like a file or a URL. Relative URIs are resolved relative to the OTP base path. | `"http://foo.bar/"`, `"file:///Users/jon/local/file"`, `"graph.obj"` | +| `time-zone` | Time-Zone ID | `"UTC"`, `"Europe/Paris"`, `"-05:00"` | +| `feed-scoped-id` | FeedScopedId | `"NO:1001"`, `"1:101"` | +| `cost-linear-function` | A cost-linear-function used to calculate a cost from another cost or time/duration. Given a function of time: ``` f(t) = a + b * t ``` then `a` is the constant time part, `b` is the time-coefficient, and `t` is the variable. If `a=0s` and `b=0.0`, then the cost is always `0`(zero). Examples: `0s + 2.5t`, `10m + 0t` and `1h5m59s + 9.9t` The `constant` must be 0 or a positive number or duration. The unit is seconds unless specified using the duration format. A duration is automatically converted to a cost. The `coefficient` must be in range: [0.0, 100.0] | | +| `time-penalty` | A time-penalty is used to add a penalty to the duration/arrival-time/departure-time for a path. It will be invisible to the end user, but used during the routing when comparing stop-arrival/paths. Given a function of time: ``` f(t) = a + b * t ``` then `a` is the constant time part, `b` is the time-coefficient, and `t` is the variable. If `a=0s` and `b=0.0`, then the cost is always `0`(zero). Examples: `0s + 2.5t`, `10m + 0 x` and `1h5m59s + 9.9t` The `constant` must be 0 or a positive number(seconds) or a duration. The `coefficient` must be in range: [0.0, 100.0] | | +| `map` | List of key/value pairs, where the key is a string and the value can be any given type. | `{ "one": 1.2, "two": 2.3 }` | +| `object` | Config object containing nested elements | `"walk": { "speed": 1.3, "reluctance": 5 }` | +| `array` | Config object containing an array/list of elements | `"array": [ 1, 2, 3 ]` | diff --git a/src/ext/java/org/opentripplanner/ext/siri/ModifiedTripBuilder.java b/src/ext/java/org/opentripplanner/ext/siri/ModifiedTripBuilder.java index 56cc28d82f4..df4509eb2d6 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/ModifiedTripBuilder.java +++ b/src/ext/java/org/opentripplanner/ext/siri/ModifiedTripBuilder.java @@ -34,7 +34,8 @@ */ public class ModifiedTripBuilder { - private static final Logger LOG = LoggerFactory.getLogger(TimetableHelper.class); + private static final Logger LOG = LoggerFactory.getLogger(ModifiedTripBuilder.class); + private final TripTimes existingTripTimes; private final TripPattern pattern; private final LocalDate serviceDate; diff --git a/src/main/java/org/opentripplanner/api/mapping/TripPlanMapper.java b/src/main/java/org/opentripplanner/api/mapping/TripPlanMapper.java index 3247b675b65..8c5459af8ed 100644 --- a/src/main/java/org/opentripplanner/api/mapping/TripPlanMapper.java +++ b/src/main/java/org/opentripplanner/api/mapping/TripPlanMapper.java @@ -21,7 +21,7 @@ public ApiTripPlan mapTripPlan(TripPlan domain) { } ApiTripPlan api = new ApiTripPlan(); api.date = Date.from(domain.date); - // The origin/destination do not have arrival/depature times; Hence {@code null} is used. + // The origin/destination do not have arrival/departure times; Hence {@code null} is used. api.from = placeMapper.mapPlace(domain.from, null, null, null, null); api.to = placeMapper.mapPlace(domain.to, null, null, null, null); api.itineraries = itineraryMapper.mapItineraries(domain.itineraries); diff --git a/src/main/java/org/opentripplanner/model/plan/pagecursor/readme.md b/src/main/java/org/opentripplanner/model/plan/pagecursor/readme.md index d0707a93a0b..e98071cfa62 100644 --- a/src/main/java/org/opentripplanner/model/plan/pagecursor/readme.md +++ b/src/main/java/org/opentripplanner/model/plan/pagecursor/readme.md @@ -18,7 +18,7 @@ moving on to the next. request to the next page. **sw'** is the search window for the new next/previous page. The search window may change between requests, so we need to account for it when computing the next/previous page cursors. -- **earliest-departure-time (edt)** The search-window start with the earliest-depature-time, which +- **earliest-departure-time (edt)** The search-window start with the earliest-departure-time, which is the first possible time any itinerary may start. **edt'** is the calculated value for the new cursor. - **latest-arrival-time (lat)** The latest time an itinerary can arrive to get accepted. The diff --git a/src/main/java/org/opentripplanner/netex/mapping/TripPatternMapper.java b/src/main/java/org/opentripplanner/netex/mapping/TripPatternMapper.java index 4babac12e03..6fa000c1049 100644 --- a/src/main/java/org/opentripplanner/netex/mapping/TripPatternMapper.java +++ b/src/main/java/org/opentripplanner/netex/mapping/TripPatternMapper.java @@ -363,7 +363,7 @@ private org.opentripplanner.transit.model.network.Route lookupRoute( private void createTripTimes(List trips, TripPattern tripPattern) { for (Trip trip : trips) { List stopTimes = result.tripStopTimes.get(trip); - if (stopTimes.size() == 0) { + if (stopTimes.isEmpty()) { issueStore.add( "TripWithoutTripTimes", "Trip %s does not contain any trip times.", diff --git a/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java b/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java index 18de8ab6e6c..f62ec56dbfc 100644 --- a/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java +++ b/src/main/java/org/opentripplanner/standalone/config/framework/json/ConfigType.java @@ -94,7 +94,7 @@ public enum ConfigType { TIME_PENALTY( JsonType.string, """ - A time-penalty is used to add a penalty to the duration/arrival-time/depature-time for + A time-penalty is used to add a penalty to the duration/arrival-time/departure-time for a path. It will be invisible to the end user, but used during the routing when comparing stop-arrival/paths. diff --git a/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java b/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java index 0d1efeea7c7..b950cdebc5e 100644 --- a/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java +++ b/src/main/java/org/opentripplanner/transit/model/timetable/ScheduledTripTimes.java @@ -20,6 +20,12 @@ import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.model.framework.DeduplicatorService; +/** + * Regular/planed/scheduled read-only version of {@link TripTimes}. The set of static + * trip-times are build during graph-build and can not be changed using real-time updates. + * + * @see RealTimeTripTimes for real-time version + */ public final class ScheduledTripTimes implements TripTimes { /** @@ -318,7 +324,7 @@ private void validate() { /** * When creating scheduled trip times we could potentially imply negative running or dwell times. * We really don't want those being used in routing. This method checks that all times are - * increasing. The first stop arrival time and the last stops depature time is NOT checked - + * increasing. The first stop arrival time and the last stops departure time is NOT checked - * these should be ignored by raptor. */ private void validateNonIncreasingTimes() { diff --git a/src/main/java/org/opentripplanner/transit/model/timetable/TripTimes.java b/src/main/java/org/opentripplanner/transit/model/timetable/TripTimes.java index f45d549fe3d..7bf1a826c1c 100644 --- a/src/main/java/org/opentripplanner/transit/model/timetable/TripTimes.java +++ b/src/main/java/org/opentripplanner/transit/model/timetable/TripTimes.java @@ -23,7 +23,7 @@ public interface TripTimes extends Serializable, Comparable { /** * Copy scheduled times, but not the actual times. */ - public RealTimeTripTimes copyScheduledTimes(); + RealTimeTripTimes copyScheduledTimes(); /** The code for the service on which this trip runs. For departure search optimizations. */ int getServiceCode(); @@ -59,7 +59,7 @@ public interface TripTimes extends Serializable, Comparable { int getDepartureDelay(int stop); /** - * Whether or not stopIndex is considered a GTFS timepoint. + * Whether stopIndex is considered a GTFS timepoint. */ boolean isTimepoint(int stopIndex);