Class BusSchedule
java.lang.Object
org.opentrafficsim.core.network.route.Route
org.opentrafficsim.road.gtu.lane.tactical.pt.BusSchedule
- All Implemented Interfaces:
Serializable
,org.djutils.base.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
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addBusStop
(String busStopId, org.djunits.value.vdouble.scalar.Time departureTime, org.djunits.value.vdouble.scalar.Duration dwellTime, boolean forceSchedule) Adds a stop to the schedule.final org.djunits.value.vdouble.scalar.Time
getActualDepartureBusStop
(String busStopId) Return the actual departure time.final org.djunits.value.vdouble.scalar.Time
getActualDepartureConflict
(String conflictId) Return the actual departure time.final org.djunits.value.vdouble.scalar.Time
getDepartureTime
(String busStopId) Returns departure time for the given bus stop.final org.djunits.value.vdouble.scalar.Duration
getDwellTime
(String busStopId) Returns dwell time for the given bus stop.final String
getLine()
final boolean
isForceSchedule
(String busStopId) Returns whether the departure time is enforced.final boolean
isLineStop
(String busStopId, org.djunits.value.vdouble.scalar.Time time) Whether the bus of this line should stop for this bus stop.final void
setActualDeparture
(String busStopId, Set<String> conflictIds, org.djunits.value.vdouble.scalar.Time time) Set actual departure time.final String
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 - Parameters:
id
- String; idgtuType
- GtuType; the GtuType for which this is a routenodes
- List<Node>; nodesline
- String; line of the bus schedule- Throws:
NetworkException
- if intermediate nodes are missing in the route.
-
BusSchedule
- Parameters:
id
- String; idgtuType
- GtuType; the GtuType for which this is a routeline
- String; line of the bus schedule
-
-
Method Details
-
addBusStop
public final void addBusStop(String busStopId, org.djunits.value.vdouble.scalar.Time departureTime, org.djunits.value.vdouble.scalar.Duration dwellTime, boolean forceSchedule) Adds a stop to the schedule.- Parameters:
busStopId
- String; bus stop iddepartureTime
- Time; departure timedwellTime
- Duration; dwell timeforceSchedule
- boolean; 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
- String; id of bus stoptime
- Time; 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
- String; id of bus stop- Returns:
- departure time for the given bus stop
-
getDwellTime
Returns dwell time for the given bus stop.- Parameters:
busStopId
- String; id of bus stop- Returns:
- dwell time for the given bus stop
-
isForceSchedule
Returns whether the departure time is enforced.- Parameters:
busStopId
- String; id of bus stop- Returns:
- whether the departure time is enforced
-
setActualDeparture
public final void setActualDeparture(String busStopId, Set<String> conflictIds, org.djunits.value.vdouble.scalar.Time time) Set actual departure time.- Parameters:
busStopId
- String; bus stop idconflictIds
- Set<String>; conflicts downstream of the bus stoptime
- Time; actual departure time
-
getActualDepartureBusStop
Return the actual departure time.- Parameters:
busStopId
- String; bus stop id- Returns:
- actual departure time,
null
if not given
-
getActualDepartureConflict
Return the actual departure time.- Parameters:
conflictId
- String; conflict id- Returns:
- actual departure time,
null
if not given
-
getLine
- Returns:
- line.
-
toString
-