forked from HSLdevcom/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #58 from ibi-group/commtrans-fares
Commtrans fares
- Loading branch information
Showing
10 changed files
with
837 additions
and
74 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
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/OrcaFareServiceFactory.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 OrcaFareServiceFactory extends DefaultFareServiceFactory { | ||
protected Map<FeedScopedId, FareRuleSet> regularFareRules = new HashMap<>(); | ||
|
||
@Override | ||
public FareService makeFareService() { | ||
return new OrcaFareServiceImpl(regularFareRules.values()); | ||
} | ||
|
||
/** | ||
* This step ensures that the fares in the source GTFS data are accounted for correctly. | ||
*/ | ||
@Override | ||
public void processGtfs(OtpTransitService transitService) { | ||
fillFareRules(null, 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.