Class BusSchedule
java.lang.Object
org.opentrafficsim.core.network.route.Route
org.opentrafficsim.road.gtu.lane.tactical.pt.BusSchedule
- All Implemented Interfaces:
Identifiable
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
ConstructorsConstructorDescriptionBusSchedule(String id, GtuType gtuType, String line) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBusStop(String busStopId, Duration departureTime, Duration dwellTime, boolean forceSchedule) Adds a stop to the schedule.getActualDepartureBusStop(String busStopId) Return the actual departure time.getActualDepartureConflict(String conflictId) Return the actual departure time.getDepartureTime(String busStopId) Returns departure time for the given bus stop.getDwellTime(String busStopId) Returns dwell time for the given bus stop.getLine()Return bus line.booleanisForceSchedule(String busStopId) Returns whether the departure time is enforced.booleanisLineStop(String busStopId, Duration time) Whether the bus of this line should stop for this bus stop.voidsetActualDeparture(String busStopId, Set<String> conflictIds, Duration time) Set actual departure time.toString()Methods inherited from class org.opentrafficsim.core.network.route.Route
addNode, contains, containsLink, destinationNode, equals, getId, getNode, getNodes, hashCode, indexOf, originNode, size, verify
-
Constructor Details
-
BusSchedule
public BusSchedule(String id, GtuType gtuType, List<Node> nodes, String line) throws NetworkException Constructor.- Parameters:
id- idgtuType- the GtuType for which this is a routenodes- nodesline- line of the bus schedule- Throws:
NetworkException- if intermediate nodes are missing in the route.
-
BusSchedule
Constructor.- Parameters:
id- idgtuType- the GtuType for which this is a routeline- line of the bus schedule
-
-
Method Details
-
addBusStop
public void addBusStop(String busStopId, Duration departureTime, Duration dwellTime, boolean forceSchedule) Adds a stop to the schedule.- Parameters:
busStopId- bus stop iddepartureTime- departure timedwellTime- dwell timeforceSchedule- whether to wait until departure time
-
isLineStop
Whether the bus of this line should stop for this bus stop. False if not the correct line, or already stopped.- Parameters:
busStopId- id of bus stoptime- time to check- Returns:
- whether the bus of this line should stop for this bus stop
-
getDepartureTime
Returns departure time for the given bus stop.- Parameters:
busStopId- id of bus stop- Returns:
- departure time for the given bus stop
-
getDwellTime
Returns dwell time for the given bus stop.- Parameters:
busStopId- id of bus stop- Returns:
- dwell time for the given bus stop
-
isForceSchedule
Returns whether the departure time is enforced.- Parameters:
busStopId- id of bus stop- Returns:
- whether the departure time is enforced
-
setActualDeparture
Set actual departure time.- Parameters:
busStopId- bus stop idconflictIds- conflicts downstream of the bus stoptime- actual departure time
-
getActualDepartureBusStop
Return the actual departure time.- Parameters:
busStopId- bus stop id- Returns:
- actual departure time, empty if not given
-
getActualDepartureConflict
Return the actual departure time.- Parameters:
conflictId- conflict id- Returns:
- actual departure time, empty if not given
-
getLine
Return bus line.- Returns:
- line.
-
toString
-