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

TariffZoneConstraint / SameZoneEnumeration should add support for new enum value "neighbouring" #654

Open
viliket opened this issue Feb 6, 2024 · 5 comments
Assignees
Labels
enhancement non semantic enhacement: technical enhancement, etc. group_decision_needed needs documentation update The NeTEx document needs to be updated
Milestone

Comments

@viliket
Copy link

viliket commented Feb 6, 2024

SameZoneEnumeration should add support for new enum value "neighbouring" to allow e.g. specifying a FareStructureElement with a GenericParameterAssignment with an EntitlementRequired with EntitlementConstraint with TariffZoneConstraint as neighbouring.

This would allow defining e.g. that one is entitled to purchase a C-zone extension ticket for a season pass valid for zones A and B since zone C is adjacent to season pass zone B. Here is a concrete example:

<FareStructureElement id="tst:Tariff@Extension@prerequisites" version="1.0">
	<Name>Prerequisites for zone extension ticket</Name>
	<GenericParameterAssignment version="1.0" id="tst:Tariff@Extension@prerequisites" order="1">
		<Name>Only available as Add on to season pass</Name>
		<TypeOfAccessRightAssignmentRef version="fxc:v1.0" ref="fxc:prerequisites"/>
		<LimitationGroupingType>AND</LimitationGroupingType>
		<limitations>
			<EntitlementRequired id="tst:Tariff@Extension@prerequisites@Period_pass" version="1.0">
				<Name>Must have a season pass with neighbouring tariff zone</Name>
				<PreassignedFareProductRef version="1.0" ref="atc:Rail@Period_pass"/>
				<EntitlementConstraint>
					<PeriodConstraint>withinSamePeriod</PeriodConstraint>
					<TariffZoneConstraint>neighbouring</TariffZoneConstraint>
				</EntitlementConstraint>
			</EntitlementRequired>
		</limitations>
	</GenericParameterAssignment>
</FareStructureElement>

The proposed naming follows neighbours ("Adjacent FARE ZONEs.") field on FareZone element.

@ue71603 ue71603 added enhancement non semantic enhacement: technical enhancement, etc. needs documentation update The NeTEx document needs to be updated group_decision_needed labels Feb 6, 2024
@ue71603 ue71603 added this to the netex_2.0 milestone Feb 6, 2024
@skinkie
Copy link
Contributor

skinkie commented Feb 7, 2024

How can a receiving system know that something is neighbouring? I would be much more happy with actual references. For example neighbouringTariffZones/TariffZoneContraintRef as a clean up in next.

@viliket
Copy link
Author

viliket commented Feb 7, 2024

How can a receiving system know that something is neighbouring? I would be much more happy with actual references. For example neighbouringTariffZones/TariffZoneContraintRef as a clean up in next.

The FareZone type has the neighbours property with documentation "Adjacent FARE ZONEs."- so in my mind if e.g. the period pass product has listed its valid fare zones the system can check from each of the listed fare zone's neighbours to see which are the neighbouring fare zones. And then for the neighbouring constraint verifying whether any of the extension ticket's selected zones is a neighbour of the season pass's fare zones.

@skinkie
Copy link
Contributor

skinkie commented Feb 7, 2024

@viliket if it already does, that works for me too.

@viliket
Copy link
Author

viliket commented Feb 7, 2024

Rethinking the proposed name of the enum value to reduce ambiguity: probably "connected" would make more sense of the intention of this constraint (from graph theory). The intention of this proposed constraint is to state that the zone extension ticket could only be sold as an add on to a season pass where the zones extend the original season pass zones while forming a connected graph so that the traveller can travel between the season pass + extension ticket zones.

<FareStructureElement id="tst:Tariff@Extension@prerequisites" version="1.0">
	<Name>Prerequisites for zone extension ticket</Name>
	<GenericParameterAssignment version="1.0" id="tst:Tariff@Extension@prerequisites" order="1">
		<Name>Only available as Add on to season pass</Name>
		<TypeOfAccessRightAssignmentRef version="fxc:v1.0" ref="fxc:prerequisites"/>
		<LimitationGroupingType>AND</LimitationGroupingType>
		<limitations>
			<EntitlementRequired id="tst:Tariff@Extension@prerequisites@Period_pass" version="1.0">
				<Name>Must have a season pass with connected tariff zones</Name>
				<PreassignedFareProductRef version="1.0" ref="atc:Rail@Period_pass"/>
				<EntitlementConstraint>
					<PeriodConstraint>withinSamePeriod</PeriodConstraint>
					<TariffZoneConstraint>connected</TariffZoneConstraint>
				</EntitlementConstraint>
			</EntitlementRequired>
		</limitations>
	</GenericParameterAssignment>
</FareStructureElement>

Below is a visualization of various examples. Note that the ↔ symbol marks the neighbourhood between the tariff zones. As stated earlier, the neighourhood can already be expressed in NeTEx by the existing neighbours property of the FareZone.

connected_zones_examples drawio

@Aurige
Copy link
Contributor

Aurige commented Feb 22, 2024

Looks Ok, to be double checked by @nick-knowles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement non semantic enhacement: technical enhancement, etc. group_decision_needed needs documentation update The NeTEx document needs to be updated
Projects
None yet
Development

No branches or pull requests

4 participants