Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance TripPolicy for more Private Lines, filter for PassengerCategory, Access Modes #349

Merged
merged 85 commits into from
Sep 19, 2023

Conversation

ue71603
Copy link
Contributor

@ue71603 ue71603 commented Apr 7, 2023

With this PR it is possible to allow a trip planner to include specialised private LINE (e.g. car pooling, school busses, company shuttles) into the trip planning.
It also allows to define necessary ACCESS MODE (e.g. that you are in a car, which restricts search to road, ferry, carTransportRail or that you can access a dragLift, because you have skis with you.
The third part makes sure, that selected by the PassengerCategory some additional things might get "unlocked". E.g. in Delemont seniors have a different service offered to them by the demand responsive service: https://www.postauto.ch/de/fahrplan-und-netz/publicar/delemont

@ue71603 ue71603 added enhancement New feature or request documentation labels Apr 7, 2023
@ue71603 ue71603 added this to the v2.0 milestone Apr 7, 2023
skinkie
skinkie previously approved these changes Apr 7, 2023
Aurige
Aurige previously approved these changes Apr 7, 2023
Copy link
Contributor

@trurlurl trurlurl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for slowing down the approval...

OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
@ue71603
Copy link
Contributor Author

ue71603 commented Apr 11, 2023

The use cases are:

• Alice wants to go to the mountain top restaurant and uses a snowboard. As the mountain top restaurant during winter is accessible by a dragLift, this should show in the trip result, because Alice sent (foot ski) in the new AccessModeList parameter.
• Bob goes from Bern to his holiday hotel in Crans Montana. He will use the carTransportRail between Kandersteg and Goppenstein. He informs himself about the waiting time and specifies his desired arrival time in Goppenstein, this results in a rail trip between Kandersteg and Goppenstein and he expands this with two trip requests (Bern – Kandersteg; Goppenstein – Crans Montana).
• Charlie wants to go to Crete. She is going with the motorcycle and needs to use a ferry that is willing to transport her and the vehicle.
• “Auto im Reisezug” we don’t have that really, but I guess this is also a use case.
• In future we will have additional use cases for Cargo transport and there it might be relevant).

OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_ModesSupport.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
@trurlurl trurlurl mentioned this pull request Apr 25, 2023
herlitze
herlitze previously approved these changes May 2, 2023
@herlitze
Copy link
Contributor

herlitze commented May 8, 2023

I added IncludePrivateLines to the StopEvent-Request as well.

@herlitze herlitze force-pushed the ExtendTripPoliciy branch from f40bffa to a734061 Compare May 8, 2023 14:30
@ue71603 ue71603 force-pushed the ExtendTripPoliciy branch from c2d5b55 to dd9540b Compare May 31, 2023 19:47
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_StopEvents.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
</PlaceRef>
</Destination>
<Params>
<PassengerCategory>Senior</PassengerCategory>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my understanding there should be the IncludeRestrictedLines flag in order to obtain the example response that includes a restricted service.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trurlurl If the PassengerCategory is set, there is no need for the IncludeRestrictedLines. It shows up. I will add an additional example showing it and a "private service".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha - to make this more clear, see the proposition on line 147.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

examples/functions/trip/TR_08_request_dog.xml Show resolved Hide resolved
<siri:ErrorCondition>
<OJPError>
<TripProblemType>TRIP_RESTRICTEDRESULTSDROPPED</TripProblemType>
</OJPError>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what cases should that error condition appear? If, e.g., we have "Senior" among the passenger categories, but IncludeRestrictedLineswas not set to true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most people will not implement this. I think this can be used, when the service knows it dropped things because they are restricted. In this case the Publicar was droopped, because: (a) no Senior (b) no IncludeRestrictedLines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I improved the example some more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PubliCar shouldn't be dropped, since ,,, "If multiple PassengerCategories are provided, then Services are shown when they are available for at least one PassengerCategory."

And in that case the error condition wouldn't appear and should be shown in another example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now only dog, even when this doesn't make completly sense.

OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
<xs:documentation>Whether alternative options should be presented as well. Mainly important for dominated journeys or in the case of ContinuousLegs the second-best route. Should be optimised for the user expectance (see. e.g https://theses.hal.science/tel-01848737). However, what the alternative options are may vary widely depending on the optimisation methods and filters.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="IncludeRestrictedLines" type="xs:boolean" minOccurs="0" default="false">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might IncludeAllRestrictedLines be a better name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@@ -143,6 +143,16 @@
<xs:documentation>Via points of the service that may help identify the vehicle to the public (In Transmodel modeled as TRIP REQUEST PLACE.TRIP VIA PLACE.GoVia; it will also most probably be detailed as a VIA and associated DESTINATION DISPLAY in the ROUTE description).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Restricted" type="xs:boolean" minOccurs="0">
<xs:annotation>
<xs:documentation>This flag is set if the service can only be used in a restricted way. For example, a specific ACCESS MODE is required (e.g. dragLift) or the LINE is only made available to certain passenger groups (e.g. school buses, hotel shuttles), as defined in PrivateMode. Restricted trumps PassengerCategory, for example. If Restricted is set to true, all services are displayed.</xs:documentation>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the last two sentences at the right place here? Or were they intended for IncludeRestrictedLines? That would match my comment on line 147.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct. changed

OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
</PlaceRef>
</Destination>
<Params>
<PassengerCategory>Senior</PassengerCategory>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha - to make this more clear, see the proposition on line 147.

<siri:ErrorCondition>
<OJPError>
<TripProblemType>TRIP_RESTRICTEDRESULTSDROPPED</TripProblemType>
</OJPError>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

OJP/OJP_JourneySupport.xsd Outdated Show resolved Hide resolved
@@ -143,6 +143,16 @@
<xs:documentation>Via points of the service that may help identify the vehicle to the public (In Transmodel modeled as TRIP REQUEST PLACE.TRIP VIA PLACE.GoVia; it will also most probably be detailed as a VIA and associated DESTINATION DISPLAY in the ROUTE description).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Restricted" type="xs:boolean" minOccurs="0">
<xs:annotation>
<xs:documentation>This flag is set if the service can only be used in a restricted way. For example, a specific ACCESS MODE is required (e.g. dragLift) or the LINE is only made available to certain passenger groups (e.g. school buses, hotel shuttles), as defined in PrivateMode. Restricted trumps PassengerCategory, for example. If Restricted is set to true, all services are displayed.</xs:documentation>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct. changed

OJP/OJP_Trips.xsd Outdated Show resolved Hide resolved
<xs:documentation>There might exist lines that have special restrictions and are not generally available to the public. E.g. school buses, company shuttles. dragLifts need to have an ACCESS MODE ski. Lines with ACCESS MODE bicycle will be included as well. If this flag is set, then existing restricted lines are considered by the router. The results are marked as restricted in the ServiceGroup. The restriction can be seen from: ACCESS MODE or PrivateMode. The usage could also be detailed with Attribute elements.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="PassengerCategory" type="PassengerCategoryEnumeration" minOccurs="0" maxOccurs="unbounded">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is ok now

</PlaceRef>
</Destination>
<Params>
<PassengerCategory>Senior</PassengerCategory>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<siri:ErrorCondition>
<OJPError>
<TripProblemType>TRIP_RESTRICTEDRESULTSDROPPED</TripProblemType>
</OJPError>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I improved the example some more.

<xs:documentation>Whether alternative options should be presented as well. Mainly important for dominated journeys or in the case of ContinuousLegs the second-best route. Should be optimised for the user expectance (see. e.g https://theses.hal.science/tel-01848737). However, what the alternative options are may vary widely depending on the optimisation methods and filters.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="IncludeRestrictedLines" type="xs:boolean" minOccurs="0" default="false">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

<siri:ErrorCondition>
<OJPError>
<TripProblemType>TRIP_RESTRICTEDRESULTSDROPPED</TripProblemType>
</OJPError>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PubliCar shouldn't be dropped, since ,,, "If multiple PassengerCategories are provided, then Services are shown when they are available for at least one PassengerCategory."

And in that case the error condition wouldn't appear and should be shown in another example.

@ue71603
Copy link
Contributor Author

ue71603 commented Sep 18, 2023

@skinkie If you could approve it also, we could merge.

@ue71603
Copy link
Contributor Author

ue71603 commented Sep 19, 2023

Are all of these changes actually related to each other in a way they have to be merged in one pull request? It isn't really easy to understand.

They came out of the same meeting and discussion (on sharing and necessary extensions). I know they are difficult to understand. But breaking them apart would not make it better.

@ue71603 ue71603 dismissed sgrossberndt’s stale review September 19, 2023 08:45

Because we are at the end of the discussion.

@skinkie skinkie merged commit 4caa609 into changes_for_v1.1 Sep 19, 2023
@skinkie skinkie deleted the ExtendTripPoliciy branch September 19, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants