Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VGF-19 implementation of call-n-ride which builds off deviated-fixed
- Loading branch information
Showing
6 changed files
with
277 additions
and
63 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
69 changes: 69 additions & 0 deletions
69
src/main/java/org/opentripplanner/routing/edgetype/flex/TemporaryDirectPatternHop.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,69 @@ | ||
/* This program is free software: you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public License | ||
as published by the Free Software Foundation, either version 3 of | ||
the License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
|
||
package org.opentripplanner.routing.edgetype.flex; | ||
|
||
import com.vividsolutions.jts.geom.LineString; | ||
import org.onebusaway.gtfs.model.Stop; | ||
import org.opentripplanner.routing.core.RoutingRequest; | ||
import org.opentripplanner.routing.core.State; | ||
import org.opentripplanner.routing.edgetype.PatternHop; | ||
import org.opentripplanner.routing.edgetype.TemporaryEdge; | ||
import org.opentripplanner.routing.vertextype.PatternStopVertex; | ||
|
||
/** | ||
* This is associated with a PatternHop for stop_time information, but its geometry bears no | ||
* relation to the route geometry. And its timing is approximate. | ||
*/ | ||
public class TemporaryDirectPatternHop extends TemporaryPartialPatternHop implements TemporaryEdge { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private int time; | ||
|
||
public TemporaryDirectPatternHop(PatternHop hop, PatternStopVertex from, PatternStopVertex to, Stop fromStop, Stop toStop, LineString geometry, int time) { | ||
super(hop, from, to, fromStop, toStop); | ||
setGeometry(geometry); | ||
this.time = time; | ||
} | ||
|
||
@Override | ||
public State traverse(State s0) { | ||
return super.traverse(s0); | ||
} | ||
|
||
@Override | ||
public boolean isUnscheduled() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isTrivial() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public double timeLowerBound(RoutingRequest options) { | ||
return time; | ||
} | ||
|
||
@Override | ||
public int getRunningTime(State s0) { | ||
return time; | ||
} | ||
|
||
@Override | ||
public void dispose() { | ||
fromv.removeOutgoing(this); | ||
tov.removeIncoming(this); | ||
} | ||
} |
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
Oops, something went wrong.