-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add HSL specific fare computation in the sandbox #4414
Conversation
@@ -33,9 +37,20 @@ public Set<P2<String>> getOriginDestinations() { | |||
return originDestinations; | |||
} | |||
|
|||
public void addRouteOriginDestination(String route, String origin, String destination) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some information about what these methods mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used for special routes in HSL where some tickets can be used outside the HSL service area when travelling between some origin and destination on a certain route. All three pieces of information are needed for determining whether a special route rule needs to be applied when computing fare information
You need to reformat your code with |
src/main/java/org/opentripplanner/routing/core/FareRuleSet.java
Outdated
Show resolved
Hide resolved
Please add documentation |
src/ext/java/org/opentripplanner/ext/fares/impl/HSLFareServiceFactory.java
Outdated
Show resolved
Hide resolved
Also, please add some contact info to this page: https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/docs/sandbox/Fares.md#custom-fare-calculators |
src/ext/java/org/opentripplanner/ext/fares/impl/HSLFareServiceImpl.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## dev-2.x #4414 +/- ##
=============================================
- Coverage 58.21% 58.16% -0.05%
- Complexity 11204 11229 +25
=============================================
Files 1480 1484 +4
Lines 59173 59331 +158
Branches 6783 6813 +30
=============================================
+ Hits 34445 34508 +63
- Misses 22667 22759 +92
- Partials 2061 2064 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
||
import java.io.Serializable; | ||
|
||
public record RouteOriginDestination(String route, String origin, String destination) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to org.opentripplanner.ext.fares.model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would cause the FareRuleSet in org.opentripplanner.routing.core
to refer to this class in ext. Is that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is ok, it already has a reference to org.opentripplanner.ext.fares.model.FareAttribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the entire FareRuleSet
could be moved to org.opentripplanner.ext.fares.model
, as it is only used by sandbox extensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small things
Co-authored-by: Hannes Junnila <[email protected]>
Co-authored-by: Hannes Junnila <[email protected]>
You need to run |
…manual edits in autogenerated files
@@ -2,16 +2,23 @@ | |||
package org.opentripplanner.ext.legacygraphqlapi.generated; | |||
|
|||
import graphql.relay.Connection; | |||
import graphql.relay.Connection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you run intelliJ "Optimize imports" for this file
...t/java/org/opentripplanner/ext/legacygraphqlapi/datafetchers/LegacyGraphQLQueryTypeImpl.java
Outdated
Show resolved
Hide resolved
It seems you need to merge in master, as there are some small conflicts with work in #4338 |
…hers/LegacyGraphQLQueryTypeImpl.java Co-authored-by: Hannes Junnila <[email protected]>
I found a |
If hsl want to merge this before I'm back from my holiday, I nominate Joel or Vesa to take over my review. ( Last time I checked there were only superficial issues left.) |
P3 and T3 are converted to named records
Summary
Adds HSL specific fare computation previously implemented in the HSL fork for OTP 1.
Unit tests