Skip to content

Commit

Permalink
fix: fuzzy logic
Browse files Browse the repository at this point in the history
  • Loading branch information
vesameskanen committed Feb 26, 2021
1 parent f8c82b9 commit a33ae45
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ protected void fillFareRules(String agencyId, Collection<FareAttribute> fareAttr
fareRule.addRouteOriginDestination(routeId.toString(), origin, destination);
} else {
fareRule.addRoute(routeId);
if (origin != null || destination != null) {
fareRule.addOriginDestination(origin, destination);
}
}
} else {
if (origin != null || destination != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ but visit temporarily (maybe 1 stop only) an 'external' zone */
for (FareRuleSet ruleSet : fareRules) {
String routeOriginDestination = String.valueOf(ride.route) + ", " + String.valueOf(ride.startZone) + ", " + String.valueOf(ride.endZone);
boolean isSpecialRoute = false;
if(ruleSet.getRoutes().size() == 1 && !ruleSet.getRouteOriginDestinations().isEmpty() && ruleSet.getRouteOriginDestinations().toString().indexOf(routeOriginDestination) != -1) {
if(!ruleSet.getRouteOriginDestinations().isEmpty() && ruleSet.getRouteOriginDestinations().toString().indexOf(routeOriginDestination) != -1) {
isSpecialRoute = true;
}
if(isSpecialRoute || (ruleSet.getRoutes().contains(ride.route) &&
Expand Down

0 comments on commit a33ae45

Please sign in to comment.