Class BusSchedule

java.lang.Object
org.opentrafficsim.core.network.route.Route
org.opentrafficsim.road.gtu.lane.tactical.pt.BusSchedule
All Implemented Interfaces:
java.io.Serializable, Identifiable

public class BusSchedule
extends Route

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version 24 jan. 2017
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    BusSchedule​(java.lang.String id, java.lang.String line)  
    BusSchedule​(java.lang.String id, java.util.List<Node> nodes, java.lang.String line)  
  • Method Summary

    Modifier and Type Method Description
    void addBusStop​(java.lang.String busStopId, Time departureTime, Duration dwellTime, boolean forceSchedule)
    Adds a stop to the schedule.
    Time getActualDepartureBusStop​(java.lang.String busStopId)
    Return the actual departure time.
    Time getActualDepartureConflict​(java.lang.String conflictId)
    Return the actual departure time.
    Time getDepartureTime​(java.lang.String busStopId)
    Returns departure time for the given bus stop.
    Duration getDwellTime​(java.lang.String busStopId)
    Returns dwell time for the given bus stop.
    java.lang.String getLine()  
    boolean isForceSchedule​(java.lang.String busStopId)
    Returns whether the departure time is enforced.
    boolean isLineStop​(java.lang.String busStopId, Time time)
    Whether the bus of this line should stop for this bus stop.
    void setActualDeparture​(java.lang.String busStopId, java.util.Set<java.lang.String> conflictIds, Time time)
    Set actual departure time.
    java.lang.String toString()

    Methods inherited from class org.opentrafficsim.core.network.route.Route

    addNode, clone, contains, destinationNode, getId, getNode, getNodes, indexOf, originNode, size, verify

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BusSchedule

      public BusSchedule​(java.lang.String id, java.util.List<Node> nodes, java.lang.String line)
      Parameters:
      id - String; id
      nodes - List<Node>; nodes
      line - String; line of the bus schedule
    • BusSchedule

      public BusSchedule​(java.lang.String id, java.lang.String line)
      Parameters:
      id - String; id
      line - String; line of the bus schedule
  • Method Details

    • addBusStop

      public final void addBusStop​(java.lang.String busStopId, Time departureTime, Duration dwellTime, boolean forceSchedule)
      Adds a stop to the schedule.
      Parameters:
      busStopId - String; bus stop id
      departureTime - Time; departure time
      dwellTime - Duration; dwell time
      forceSchedule - boolean; whether to wait until departure time
    • isLineStop

      public final boolean isLineStop​(java.lang.String busStopId, Time time)
      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 stop
      time - Time; time to check
      Returns:
      whether the bus of this line should stop for this bus stop
    • getDepartureTime

      public final Time getDepartureTime​(java.lang.String busStopId)
      Returns departure time for the given bus stop.
      Parameters:
      busStopId - String; id of bus stop
      Returns:
      departure time for the given bus stop
    • getDwellTime

      public final Duration getDwellTime​(java.lang.String busStopId)
      Returns dwell time for the given bus stop.
      Parameters:
      busStopId - String; id of bus stop
      Returns:
      dwell time for the given bus stop
    • isForceSchedule

      public final boolean isForceSchedule​(java.lang.String busStopId)
      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​(java.lang.String busStopId, java.util.Set<java.lang.String> conflictIds, Time time)
      Set actual departure time.
      Parameters:
      busStopId - String; bus stop id
      conflictIds - Set<String>; conflicts downstream of the bus stop
      time - Time; actual departure time
    • getActualDepartureBusStop

      public final Time getActualDepartureBusStop​(java.lang.String busStopId)
      Return the actual departure time.
      Parameters:
      busStopId - String; bus stop id
      Returns:
      actual departure time, null if not given
    • getActualDepartureConflict

      public final Time getActualDepartureConflict​(java.lang.String conflictId)
      Return the actual departure time.
      Parameters:
      conflictId - String; conflict id
      Returns:
      actual departure time, null if not given
    • getLine

      public final java.lang.String getLine()
      Returns:
      line.
    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class Route