Class BusSchedule

    • Constructor Detail

      • BusSchedule

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

        public BusSchedule​(String id,
                           String line)
        Parameters:
        id - String; id
        line - String; line of the bus schedule
    • Method Detail

      • addBusStop

        public final void addBusStop​(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​(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​(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​(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​(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​(String busStopId,
                                             Set<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​(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​(String conflictId)
        Return the actual departure time.
        Parameters:
        conflictId - String; conflict id
        Returns:
        actual departure time, null if not given
      • getLine

        public final String getLine()
        Returns:
        line.