Class BusStop

All Implemented Interfaces:
java.io.Serializable, Locatable, EventProducerInterface, Identifiable, Drawable, ObjectInterface, LaneBasedObject

public class BusStop
extends AbstractLaneBasedObject
A bus stop is a location on a lane. The stop has a name, and a set of lines. At a single stop in reality, there may be different locations where busses stop for different lines. A BusStop pertains to only one such location. The bus stop in reality is represented by a shared name over a few BusStop's, with different lines. As lines may also be set dynamically, the name and lines are insufficient to identify a specific BusStop. Hence there is a fixed unique id per BusStop.

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 Details

    • BusStop

      public BusStop​(java.lang.String id, Lane lane, Length longitudinalPosition, java.lang.String name, SimulatorInterface.TimeDoubleUnit simulator) throws NetworkException
      Parameters:
      id - String; id
      lane - Lane; lane
      longitudinalPosition - Length; position
      name - String; name of stop
      simulator - SimulatorInterface.TimeDoubleUnit; the simulator to schedule on
      Throws:
      NetworkException - when the position on the lane is out of bounds
  • Method Details

    • setLines

      public final void setLines​(java.util.Set<java.lang.String> lines)
      Sets the lines.
      Parameters:
      lines - Set<String>; lines that stop at this location
    • getLines

      public final ImmutableSet<java.lang.String> getLines()
      Returns the lines set.
      Returns:
      whether the lines belongs to this stop
    • getConflicts

      public final java.util.Set<Conflict> getConflicts()
      Returns the downstream conflicts of the bus stop. Search is only performed over links with BUS_STOP priority.
      Returns:
      downstream conflicts of the given conflict
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public final boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class AbstractLaneBasedObject
    • clone

      Clone the LaneBasedObject for e.g., copying a network.
      Specified by:
      clone in class AbstractLaneBasedObject
      Parameters:
      newCSE - CrossSectionElement; the new cross section element to which the clone belongs
      newSimulator - SimulatorInterface.TimeDoubleUnit; the new simulator for this network
      Returns:
      AbstractLaneBasedObject; a clone of this object
      Throws:
      NetworkException - in case the cloning fails