forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from ibi-group/atl-fare-module
Atl fare module
- Loading branch information
Showing
6 changed files
with
747 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/org/opentripplanner/routing/impl/ATLFareServiceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.opentripplanner.routing.impl; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import org.opentripplanner.model.FeedScopedId; | ||
import org.opentripplanner.model.OtpTransitService; | ||
import org.opentripplanner.routing.core.FareRuleSet; | ||
import org.opentripplanner.routing.services.FareService; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class ATLFareServiceFactory extends DefaultFareServiceFactory { | ||
protected Map<FeedScopedId, FareRuleSet> regularFareRules = new HashMap<>(); | ||
|
||
@Override | ||
public FareService makeFareService() { | ||
return new ATLFareServiceImpl(regularFareRules.values()); | ||
} | ||
|
||
/** | ||
* This step ensures that the fares in the source GTFS data are accounted for correctly. | ||
*/ | ||
@Override | ||
public void processGtfs(OtpTransitService transitService) { | ||
fillFareRules(transitService.getAllFareAttributes(), transitService.getAllFareRules(), regularFareRules); | ||
} | ||
|
||
/** | ||
* There is no configuration code in DefaultFareServiceFactory. We override the super class's method just in case it changes. | ||
*/ | ||
@Override | ||
public void configure(JsonNode config) { | ||
// No configuration at the moment. | ||
} | ||
} |
Oops, something went wrong.