Skip to content

Commit

Permalink
Align handling of MultiPointType (#443)
Browse files Browse the repository at this point in the history
Improve documentation for several elements regarding `MultiPointType` and align its element definition in request and response.
  • Loading branch information
ue71603 authored Sep 11, 2024
1 parent a3549ca commit c214441
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion OJP/OJP_JourneySupport.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@
<xs:choice minOccurs="0">
<xs:element name="NumberOfResults" type="xs:positiveInteger" minOccurs="0">
<xs:annotation>
<xs:documentation>The number of trip results that the user wants to see at least (TRIP REQUEST POLICY.maximumNumberofJourneys). Be aware that some implementations will deliver one of the TripResults before the indicated departure time. This means one always must check the results against the parameters before using them.</xs:documentation>
<xs:documentation>The number of trip results that the user wants to see at least. Be aware that some implementations will deliver one of the TripResults before the indicated departure time. This means that you can't assume that you get the exact number of results that you asked for in the request from the server.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:group ref="NumberOfResultsGroup" minOccurs="0"/>
Expand Down
21 changes: 9 additions & 12 deletions OJP/OJP_Trips.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1380,44 +1380,41 @@ Can only be used when both participants recognise the same schedule version. If
</xs:annotation>
<xs:sequence>
<xs:group ref="BaseTripPolicyGroup"/>
<xs:element name="MultiPointType" type="MultiPointTypeEnumeration" default="anyPoint">
<xs:element name="MultiPointType" type="MultiPointTypeEnumeration" minOccurs="0" default="anyPoint">
<xs:annotation>
<xs:documentation>If a solution for any one of multiple origin/destination points is sufficient. Or a distinct solution for each of the origin/destination points has to be found.</xs:documentation>
<xs:documentation>Defines how the router should handle requests with multiple origins and destinations. As it is important for the strategy of the distributed trip planning the MultiPointType should be set. If the type is not supported a TRIP_MULTIPOINT_TYPE_NOT_SUPPORTED warning or error must be returned. Default is anyPoint.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:group>
<xs:simpleType name="MultiPointTypeEnumeration">
<xs:annotation>
<xs:documentation>How the multiple origin/destination points should be considered.
Note: Unfortunately, this element was not sufficiently defined in the past, which led to different implementations.
Note: MultiPointType trumps the number of results. If the algorithm thinks it is necessary to provide more results, it should.
</xs:documentation>
<xs:documentation>Defines how the router should handle requests with multiple origins and destinations. MultiPointType is more important than NumberOfResults in the sense that if 10 results are needed to fulfill the MultiPointType, then it is 10, even when NumberOfResults was set to 1.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="anyPoint">
<xs:annotation>
<xs:documentation>If a solution for any one of multiple origin/destination points is sufficient. Some implementations will return only one origin-destination pair even for multiple results with this setting. Others will provide multiple.</xs:documentation>
<xs:documentation>Returning results for a single origin and destination (hopefully the best ones). As this element was not sufficiently defined in the past, some implementations may behave differently.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="eachOrigin">
<xs:annotation>
<xs:documentation>A distinct solution for each of the origin points must be found.</xs:documentation>
<xs:documentation>At least a distinct solution for each of the origin points must be delivered.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="eachDestination">
<xs:annotation>
<xs:documentation>A distinct solution for each of the destination points must be found.</xs:documentation>
<xs:documentation>At least a distinct solution for each of the destination points must be delivered.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="eachOriginDestination">
<xs:annotation>
<xs:documentation>At least a result for each Origin-Destination pair must be presented.</xs:documentation>
<xs:documentation>At least one result for each origin/destination pair must be delivered.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="somePoints">
<xs:annotation>
<xs:documentation>Clarifies that some (probably the "best") origin-destination pairs should be returned.</xs:documentation>
<xs:documentation>Clarifies that some (probably the "best") origin-destination pairs should be returned. How many are to be used is not defined.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
Expand All @@ -1430,7 +1427,7 @@ Can only be used when both participants recognise the same schedule version. If
<xs:documentation>Multi-point trip response structure.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="MultiPointType" type="MultiPointTypeEnumeration" minOccurs="0">
<xs:element name="MultiPointType" type="MultiPointTypeEnumeration" minOccurs="0" default="anyPoint">
<xs:annotation>
<xs:documentation>The MultiPointType should be returned because it may differ from the one asked. Many systems will support only a subset of the MultiPointTypes, and it is important to know what the result is based on.</xs:documentation>
</xs:annotation>
Expand Down

0 comments on commit c214441

Please sign in to comment.